Bird
0
0

Which parameter configuration correctly enforces this restriction and allows multiple zones?

hard📝 Best Practice Q15 of 15
AWS - CloudFormation
You want to create a CloudFormation template that asks for a list of availability zones but only allows zones in us-east-1. Which parameter configuration correctly enforces this restriction and allows multiple zones?
A"Parameters": { "AZList": { "Type": "List<AWS::EC2::AvailabilityZone::Name>", "AllowedValues": ["us-east-1a", "us-east-1b", "us-east-1c"] } }
B"Parameters": { "AZList": { "Type": "CommaDelimitedList" } }
C"Parameters": { "AZList": { "Type": "List<String>", "Default": "us-east-1a,us-east-1b" } }
D"Parameters": { "AZList": { "Type": "String", "AllowedValues": ["us-east-1a", "us-east-1b", "us-east-1c"] } }
Step-by-Step Solution
Solution:
  1. Step 1: Identify parameter type for multiple AZs

    To accept multiple availability zones, use the type List with AWS::EC2::AvailabilityZone::Name for validation.
  2. Step 2: Check AllowedValues for region restriction

    AllowedValues limits input to only the specified zones in us-east-1.
  3. Step 3: Evaluate options

    "Parameters": { "AZList": { "Type": "List", "AllowedValues": ["us-east-1a", "us-east-1b", "us-east-1c"] } } uses correct List type and AllowedValues. "Parameters": { "AZList": { "Type": "CommaDelimitedList" } } uses CommaDelimitedList but lacks AllowedValues restriction. "Parameters": { "AZList": { "Type": "List", "Default": "us-east-1a,us-east-1b" } } lacks AllowedValues restriction. "Parameters": { "AZList": { "Type": "String", "AllowedValues": ["us-east-1a", "us-east-1b", "us-east-1c"] } } uses String type which accepts only one value.
  4. Final Answer:

    "Parameters": { "AZList": { "Type": "List", "AllowedValues": ["us-east-1a", "us-east-1b", "us-east-1c"] } } -> Option A
  5. Quick Check:

    List type + AllowedValues restrict multiple inputs [OK]
Quick Trick: Use List type with AllowedValues for multiple restricted inputs [OK]
Common Mistakes:
  • Using String type for multiple values
  • Using CommaDelimitedList without proper validation
  • Not restricting AllowedValues to region zones

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes