
Explanation:
In AWS CloudFormation, for the resource type AWS::EC2::Instance, the PrivateDnsName is a read-only attribute that is assigned by AWS after the instance is launched. It cannot be specified as a property in the template. If you try to define it, the stack creation will fail because the property is not supported for input.
Ultimate access to all questions.
Question #1
A CloudOps engineer is examining the following AWS CloudFormation template:
AWSTemplateFormatVersion: '2010-09-09'
Description: 'Creates an EC2 Instance'
Resources:
EC2Instance:
Type: AWS::EC2::Instance
Properties:
ImageId: ami-79fdTeee
InstanceType: m5n.large
SubnetId: subnet-1abc3d3fg
PrivateDnsName: ip-10-24-34-0.ec2.internal
Tags:
- Key: Name
Value: !Sub "${AWS::StackName} Instance"
AWSTemplateFormatVersion: '2010-09-09'
Description: 'Creates an EC2 Instance'
Resources:
EC2Instance:
Type: AWS::EC2::Instance
Properties:
ImageId: ami-79fdTeee
InstanceType: m5n.large
SubnetId: subnet-1abc3d3fg
PrivateDnsName: ip-10-24-34-0.ec2.internal
Tags:
- Key: Name
Value: !Sub "${AWS::StackName} Instance"
Why will the stack creation fail?
A
The Outputs section of the CloudFormation template was omitted.
B
The Parameters section of the CloudFormation template was omitted.
C
The PrivateDnsName cannot be set from a CloudFormation template.
D
The VPC was not specified in the CloudFormation template.
E
None of the above
F
All of the above
No comments yet.