From 6b7a006a119b846f68c77cce23292868882cb8c4 Mon Sep 17 00:00:00 2001 From: Katsuhisa Kitano <91katsuhisa@gmail.com> Date: Fri, 13 Sep 2024 00:36:10 +0900 Subject: [PATCH] Fix: Replace SecurityGroups with SecurityGroupIds in YAML template - Updated the EC2 instance configuration to use security group IDs instead of names. - This resolves the conflict between the subnet and groupName parameters. --- EC2/EC2InstanceWithSecurityGroupSample.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/EC2/EC2InstanceWithSecurityGroupSample.yaml b/EC2/EC2InstanceWithSecurityGroupSample.yaml index 1c2549ee..ff57791f 100644 --- a/EC2/EC2InstanceWithSecurityGroupSample.yaml +++ b/EC2/EC2InstanceWithSecurityGroupSample.yaml @@ -83,8 +83,8 @@ Resources: SubnetId: !Select - 0 - !Ref Subnets - SecurityGroups: - - !Ref InstanceSecurityGroup + SecurityGroupIds: + - !GetAtt InstanceSecurityGroup.GroupId KeyName: !Ref KeyName ImageId: !Ref LatestAmiId