In this lesson we’ll learn how to retrieve values from a CloudFormation Mappings block using the !FindInMap intrinsic function. Mappings are useful for storing static lookup data (for example, environment-specific settings or role-to-profession mappings) and then referencing those values elsewhere in your template. Mappings exampleDocumentation Index
Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
Use this file to discover all available pages before exploring further.
| Argument | Purpose | Example |
|---|---|---|
| Mapping name | The Mappings block name to search | DevMap |
| Top-level key | The first-level key inside the mapping | Arno or Alice |
| Second-level key | The nested key whose value you want | Field |
- The !FindInMap invocation returns the value at Mappings → DevMap → Arno → Field, which is “Quality assurance”.
- The Developer tag is populated from the InputDeveloperName parameter so the developer name appears in the S3 console; Profession is taken from the mapping instead of being hard-coded in the Tags list.
- You can make the top-level key dynamic (for example, by referencing a parameter instead of hard-coding “Arno”) to select different mapped values at stack creation or update time.
Putting the top-level key in quotes (for example, “Arno”) is optional in YAML, but quoting can prevent parsing ambiguity and improve readability.
- In the CloudFormation console choose Update stack → Replace current template → Upload a template file → Choose file.
- Proceed to the Specify stack details page and fill parameters such as InputBucketName and InputDeveloperName.
- Complete the update and wait for the stack update to finish.


- Developer tag shows the parameter value “Arno”.
- Profession tag shows “Quality assurance” (the value resolved from DevMap → Arno → Field).

- !FindInMap requires three arguments: mapping name, top-level key, and second-level key.
- Use Mappings to centralize static lookup data and avoid duplication across your template.
- Combine Parameters and Mappings to let users control keys (top-level lookup) while still resolving other values from a central mapping.
- CloudFormation Overview
- Intrinsic function: !FindInMap
- Mappings section structure
- Update a stack (CloudFormation)
- Amazon S3 Documentation