
A senior administrator in a multinational organization needs to include a comment in the template shown in the exhibit to ensure that administrators from other regions change the EC2 instance size value to one that meets the requirements in their local deployments. How can the administrator add the comment in that section of the file? (Choose one answer)
Show answerHide answer
Correct answer: D The administrator can add the comment with the # character next to the InstanceType section.
Explanation
Explanation:✅ Correct Answer:
D. The administrator can add the comment with the # character next to the InstanceType section.
The exhibit shows a CloudFormation template in YAML format. YAML natively supports single-line comments using the # character. The administrator can add a comment on the same line as the InstanceType key or on a separate line above it to document that the value should be changed to meet local deployment requirements. For example: InstanceType: t2.large # CHANGE TO LOCAL REQUIREMENT. This is a standard and effective method for inline documentation within YAML-based templates.
❌ Incorrect Answers:
A. The administrator can run the aws cloudformation update-stack and include the comment.
The update-stack command is used to deploy changes to a stack, not to embed human-readable comments within the template file itself. Comments are for template authors and readers, not a parameter for the deployment command.
B. The administrator must update the AWSTemplateFormatVersion to a more current version.
The version specified ("2010-09-09") is the fundamental template format version and is still current. Changing it does not enable or relate to the ability to add comments; comments are a feature of the YAML/JSON syntax, not the template format version.
C. The administrator must convert the template to JSON format before adding the comment.
This is incorrect and counterproductive. JSON does not support comments as part of its official specification. Converting to JSON would actually remove the ability to add compliant comments. YAML is the preferred format for readable CloudFormation templates precisely because it supports features like comments.
🔧 Key Insight:
For AWS CloudFormation templates written in YAML, inline documentation for other administrators is best achieved using the native comment syntax. Adding a comment prefixed with # next to the InstanceType parameter is the correct, simple, and standards-compliant approach to indicate that the value is region-specific and should be reviewed.
Reference:
AWS CloudFormation User Guide: AWS CloudFormation Template Formats.


