Bird
0
0

Which intrinsic function should you use to get the first element?

hard📝 Application Q9 of 15
AWS - CloudFormation
You want to create a parameter that accepts a list of security group IDs and then use only the first security group ID in your template. Which intrinsic function should you use to get the first element?
AFn::Select with index 0
BFn::Join with delimiter ','
CRef to get the first element
DFn::Split with delimiter ','
Step-by-Step Solution
Solution:
  1. Step 1: Understand how to access elements in a list parameter

    Fn::Select lets you pick an element by index from a list.
  2. Step 2: Identify the function to get the first element

    Using Fn::Select with index 0 returns the first item in the list.
  3. Final Answer:

    Fn::Select with index 0 -> Option A
  4. Quick Check:

    Use Fn::Select to pick list elements by index [OK]
Quick Trick: Fn::Select picks list elements by index [OK]
Common Mistakes:
  • Using Ref to get list element (returns whole list)
  • Using Fn::Join or Fn::Split incorrectly
  • Confusing list access with string manipulation

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes