Complete the code to define the AWS CloudFormation template version.
{
"AWSTemplateFormatVersion": "[1]",
"Resources": {}
}The correct AWS CloudFormation template version is 2010-09-09.
Complete the code to specify the description field in the AWS CloudFormation template.
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "[1]",
"Resources": {}
}The Description field should be a short text describing the template, such as My AWS CloudFormation Template.
Fix the error in the Resources section by completing the resource type.
{
"Resources": {
"MyBucket": {
"Type": "[1]",
"Properties": {
"BucketName": "my-sample-bucket"
}
}
}
}The resource type for an S3 bucket is AWS::S3::Bucket.
Fill both blanks to define an EC2 instance with a specific instance type and AMI ID.
{
"Resources": {
"MyInstance": {
"Type": "AWS::EC2::Instance",
"Properties": {
"InstanceType": "[1]",
"ImageId": "[2]"
}
}
}
}The InstanceType is commonly t2.micro for small instances, and the ImageId is a valid AMI ID like ami-0abcdef1234567890.
Fill all three blanks to define an IAM role with assume role policy and managed policy ARN.
{
"Resources": {
"MyRole": {
"Type": "AWS::IAM::Role",
"Properties": {
"AssumeRolePolicyDocument": [1],
"Path": "[2]",
"ManagedPolicyArns": ["[3]"]
}
}
}
}The AssumeRolePolicyDocument must allow EC2 service to assume the role, the Path is usually "/", and the ManagedPolicyArns can include the AmazonS3ReadOnlyAccess policy ARN.