Bird
0
0

What is wrong with this YAML snippet for a CloudFormation template?

medium📝 Debug Q7 of 15
AWS - CloudFormation
What is wrong with this YAML snippet for a CloudFormation template?
Resources:
  MyBucket:
    Type: AWS::S3::Bucket
    Properties:
      BucketName: my-bucket
      Tags:
        - Key: Name
          Value: my-bucket
ABucketName should not be specified
BYAML requires all keys in uppercase
CType value must be quoted
DTags list indentation is incorrect
Step-by-Step Solution
Solution:
  1. Step 1: Check YAML indentation rules

    YAML is sensitive to indentation; list items under Tags must be properly indented.
  2. Step 2: Identify indentation error

    Tags list items should be indented two spaces more than Tags key; here indentation is incorrect.
  3. Step 3: Re-examine options

    BucketName is allowed, Type does not require quotes, keys can be lowercase.
  4. Final Answer:

    Tags list indentation is incorrect -> Option D
  5. Quick Check:

    YAML indentation errors cause issues = B [OK]
Quick Trick: YAML indentation must be consistent for lists [OK]
Common Mistakes:
  • Incorrect indentation for lists
  • Thinking quotes are always required
  • Assuming uppercase keys only

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes