Using AWS CloudFormation, a developer needs to set a Lambda function timeout based on a template parameter named Environment. The template contains a mapping called EnvironmentData that stores timeout values per environment. Which intrinsic function should be used to set the Timeout from the mapping?
Choose an answer
Tap an option to check your answer.
Correct answer: Timeout: !FindInMap [EnvironmentData, !Ref Environment, Timeout].
Why this is the answer
The !FindInMap intrinsic function is designed to retrieve a value from a mapping based on specified keys. In this scenario, EnvironmentData is the mapping name, !Ref Environment dynamically provides the top-level key (e.g., 'Dev', 'Prod'), and Timeout is the second-level key within that environment's data. This correctly extracts the timeout value. !GetAtt is used to retrieve an attribute from a resource, not a value from a mapping. !Select retrieves a single object from a list by index, which is not applicable here. !ForEach is not a valid CloudFormation intrinsic function for this purpose; it's typically used in programming languages for iteration.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed