Question
A CloudOps engineer is examining the following AWS CloudFormation template:
```yaml
AWSTemplateFormatVersion: '2010-09-09'
Description: 'Creates an EC2 Instance'
Resources:
EC2Instance:
Type: AWS::EC2::Instance
Properties:
ImageId: ami-75fd7ee
InstanceType: m5n.large
SubnetId: subnet-1abc3d3f
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 sot from a CloudFormation template. Correct
- D. The VPC was not specified in the CloudFormation template.
Explanation
The stack creation will fail because the 'PrivateDnsName' property cannot be set directly in a CloudFormation template for an EC2 instance. According to AWS documentation, the PrivateDnsName is automatically assigned by AWS and cannot be specified manually.