-
Notifications
You must be signed in to change notification settings - Fork 4.2k
feat(s3-deployment): support \Fn::FindInMap in deploy-time values for
Source.jsonData
#34186
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pull request linter fails with the following errors:
❌ Features must contain a change to an integration test file and the resulting snapshot.
If you believe this pull request should receive an exemption, please comment and provide a justification. A comment requesting an exemption should contain the text Exemption Request
. Additionally, if clarification is needed, add Clarification Request
to a comment.
in deploy-time values for
Source.jsonData in deploy-time values for
Source.jsonData
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Clarification Request: We are unsure why this change fails integration tests despite having an integration test in our build which works |
Hi @arvchahal, after adding the integration test you will need to deploy it locally to update the integration test snapshots and then push those to the PR. Instructions for building and running the integ tests can be found here. Could you also add assertions to your integration test to verify that the behaviour works as expected? Feel free to check our guide on that here. |
This PR has been in the CHANGES REQUESTED state for 3 weeks, and looks abandoned. Note that PRs with failing linting check or builds are not reviewed, please ensure your build is passing To prevent automatic closure:
This PR will automatically close in 14 days if no action is taken. |
This PR has been deemed to be abandoned, and will be automatically closed. Please create a new PR for these changes if you think this decision has been made in error. |
Comments on closed issues and PRs are hard for our team to see. |
Issue #30369
Closes #30369
Reason for this change
In large APIs with custom response templates—such as structured code error mappings—it’s common to rely on CfnMapping to reduce template size and avoid CloudFormation’s 1MB limit. Repeating the same mapping multiple times causes CloudFormation to raise an error due to template size constraints.
By allowing Fn::FindInMap to be used in Source.jsonData, developers can define mappings once and reuse them across resources, optimizing template size and maintainability.
Description of changes
• Added support for Fn::FindInMap in deploy-time JSON data passed via
Source.jsonData(...).
• Extended the renderData() logic to recognize Fn::FindInMap as a valid
intrinsic.
• Added unit and integration tests to validate this support.
Describe any new or updated permissions being added
N/A – no new permissions are introduced in this change.
Description of how you validated changes
• Added unit tests covering:
• Valid use of Fn::FindInMap inside strings and as standalone values
• Marker resolution for mixed Fn::Join inputs
• Edge cases (e.g., invalid intrinsics, lazy resolution)
• Added an integration test that synthesizes a stack using Fn::FindInMap within Source.jsonData and confirms successful binding.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license