Which of the following lists correctly shows the main sections of a valid AWS CloudFormation template in JSON or YAML?
Think about the sections that define inputs, resources, and outputs in a CloudFormation template.
A valid AWS CloudFormation template includes sections like Parameters (for inputs), Resources (for AWS resources), Outputs (for exported values), Mappings (static variables), Conditions (to control resource creation), Transform (for macros), and Metadata (additional info).
Given the following JSON snippet of a CloudFormation template, how many AWS resources are defined?
{
"Resources": {
"MyBucket": {
"Type": "AWS::S3::Bucket"
},
"MyQueue": {
"Type": "AWS::SQS::Queue"
},
"MyTopic": {
"Type": "AWS::SNS::Topic"
}
}
}Count the top-level keys inside the Resources section.
The Resources section contains three keys: MyBucket, MyQueue, and MyTopic, each defining one AWS resource.
Which YAML snippet correctly uses a condition to create an AWS resource only if a parameter value is 'true'?
Check the parameter type, allowed values, and how the condition compares the parameter value.
Option D correctly defines the parameter as String with allowed values 'true' and 'false', and the condition compares the parameter value as a string 'true'. The resource uses the condition to control creation.
Review the following JSON snippet. What is the main security risk?
{
"Resources": {
"MyBucket": {
"Type": "AWS::S3::Bucket",
"Properties": {
"BucketName": "my-public-bucket",
"AccessControl": "PublicRead"
}
}
}
}Consider what 'PublicRead' means for an S3 bucket's accessibility.
Setting AccessControl to 'PublicRead' makes the bucket contents readable by anyone on the internet, which is a security risk if sensitive data is stored.
Given a CloudFormation template with an AWS::EC2::Instance resource, if you update the template to change the instance type from 't2.micro' to 't3.micro' and then update the stack, what will happen?
Consider how CloudFormation handles changes to properties that require resource replacement.
Changing the instance type of an EC2 instance requires replacement. CloudFormation creates a new instance with the new type and deletes the old one, causing downtime during the swap.