Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: Fn.findInMap Should Support Default Value #26125

Closed
2 tasks
drobbins-ancile opened this issue Jun 26, 2023 · 3 comments · Fixed by #26543
Closed
2 tasks

core: Fn.findInMap Should Support Default Value #26125

drobbins-ancile opened this issue Jun 26, 2023 · 3 comments · Fixed by #26543
Assignees
Labels
@aws-cdk/core Related to core CDK functionality effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p1

Comments

@drobbins-ancile
Copy link

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

@drobbins-ancile drobbins-ancile added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Jun 26, 2023
@github-actions github-actions bot added the @aws-cdk/core Related to core CDK functionality label Jun 26, 2023
@pahud
Copy link
Contributor

pahud commented Jun 26, 2023

Yes, we should add this feature.

public findInMap(key1: string, key2: string): string {

@pahud pahud added p1 effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Jun 26, 2023
@drobbins-ancile
Copy link
Author

Any chance we can get this added to the roadmap? It appears to be pretty low effort.

@scanlonp scanlonp self-assigned this Jul 26, 2023
@scanlonp scanlonp changed the title core: Fn.find_in_map Should Support Default Value core: Fn.findInMap Should Support Default Value Aug 8, 2023
@mergify mergify bot closed this as completed in #26543 Aug 8, 2023
mergify bot pushed a commit that referenced this issue Aug 8, 2023
Cloudformation recently [added support](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-findinmap-enhancements.html) for a default value in the FindInMap intrinsic function. This adds that support.

Closes #26125.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link

github-actions bot commented Aug 8, 2023

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/core Related to core CDK functionality effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants