Skip to content

core: Fn.findInMap Should Support Default Value #26125

@drobbins-ancile

Description

@drobbins-ancile

Describe the feature

Cloudformation recently added support for a default value in the FindInMap intrinsic function. AWS CDK should also support a default value.

Use Case

We use the CDK to synthesize cloudformation templates for deployment in multiple environments. Thus we are not able to use language features to replicate this functionality. We need to be able to use a default value when a parameter value does not exist in a mapping.

Proposed Solution

Add a Default parameter to the find_in_map method that would be used if no match is found in the mapping based on the provided 1st/2nd level keys.

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

latest

Environment details (OS name and version, etc.)

AWS Linux 2023, Ubuntu 22.04

Metadata

Metadata

Assignees

Labels

@aws-cdk/coreRelated to core CDK functionalityeffort/mediumMedium work item – several days of effortfeature-requestA feature should be added or improved.p1

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions