
Explanation:
Fn::GetAtt on AWS::EC2::SecurityGroup with the GroupId attribute returns the physical security group ID (sg-xxxxxxx), which is the correct value for SecurityGroupIds.
Ultimate access to all questions.
A template uses Fn::GetAtt as shown. What value does SecurityGroupId resolve to?
Resources:
AppSG:
Type: AWS::EC2::SecurityGroup
Properties:
GroupDescription: App tier SG
VpcId: !Ref MyVPC
AppInstance:
Type: AWS::EC2::Instance
Properties:
ImageId: ami-0abcdef1234567890
InstanceType: t3.micro
SecurityGroupIds:
- !GetAtt AppSG.GroupId
Resources:
AppSG:
Type: AWS::EC2::SecurityGroup
Properties:
GroupDescription: App tier SG
VpcId: !Ref MyVPC
AppInstance:
Type: AWS::EC2::Instance
Properties:
ImageId: ami-0abcdef1234567890
InstanceType: t3.micro
SecurityGroupIds:
- !GetAtt AppSG.GroupId
A
The ARN of the AppSG security group
B
The physical resource ID (sg-xxxxxxxx) of AppSG
C
The GroupDescription string 'App tier SG'
D
The VPC ID associated with AppSG
No comments yet.