Bird
0
0

You wrote this YAML snippet for a CloudFormation template but it fails to deploy:

medium📝 Debug Q14 of 15
AWS - CloudFormation
You wrote this YAML snippet for a CloudFormation template but it fails to deploy:
Resources:
  MyInstance:
    Type: AWS::EC2::Instance
    Properties:
      ImageId: ami-12345678
      InstanceType: t2.micro
      SecurityGroups: my-security-group

What is the likely error?
AInstanceType is invalid for EC2
BImageId must be a number, not a string
CSecurityGroups should be a list, not a single string
DResources section name is misspelled
Step-by-Step Solution
Solution:
  1. Step 1: Check the SecurityGroups property format

    SecurityGroups expects a list of strings, but here it is a single string.
  2. Step 2: Validate other properties

    ImageId is a string (correct), InstanceType is valid, Resources is spelled correctly.
  3. Final Answer:

    SecurityGroups should be a list, not a single string -> Option C
  4. Quick Check:

    SecurityGroups needs list format = A [OK]
Quick Trick: Lists must be in brackets or dash format in YAML [OK]
Common Mistakes:
  • Using string instead of list for SecurityGroups
  • Assuming ImageId is numeric
  • Misspelling Resources section

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes