
Explanation:
Using Fn::GetAtt on an AWS::EC2::SecurityGroup resource with the GroupId attribute returns the physical ID of the security group (e.g., sg-0123456789abcdef0). This is the standard way to reference a security group ID in other resources like EC2 instances.
Ultimate access to all questions.
Question 15
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
E
None of the above
F
Not applicable
No comments yet.