From 4949aa2e35908b50ad17258ebbff2399aec50a4d Mon Sep 17 00:00:00 2001 From: DiegoVictor Date: Tue, 18 Jun 2024 17:41:12 -0300 Subject: [PATCH] Move egress rule to a separated resource --- infrastructure.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/infrastructure.yml b/infrastructure.yml index 75bdf20..332a9d4 100644 --- a/infrastructure.yml +++ b/infrastructure.yml @@ -99,10 +99,15 @@ Resources: FromPort: -1 ToPort: -1 DestinationSecurityGroupId: !GetAtt RdsSecurityGroup.GroupId - - IpProtocol: tcp - FromPort: 443 - ToPort: 443 - DestinationSecurityGroupId: !GetAtt SecretsManagerEndpointSecurityGroup.GroupId + + LambdaSecurityGroupEgress: + Type: AWS::EC2::SecurityGroupEgress + Properties: + GroupId: !GetAtt LambdaSecurityGroup.GroupId + IpProtocol: tcp + FromPort: 443 + ToPort: 443 + DestinationSecurityGroupId: !GetAtt SecretsManagerEndpointSecurityGroup.GroupId SecretsManagerEndpointSecurityGroup: Type: AWS::EC2::SecurityGroup