Skip to content

Conversation

arvchahal
Copy link

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

@github-actions github-actions bot added beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2 labels Apr 17, 2025
@aws-cdk-automation aws-cdk-automation requested a review from a team April 17, 2025 20:47
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a 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.

@arvchahal arvchahal changed the title feat(aws-s3-deployment): support \Fn::FindInMap in deploy-time values for Source.jsonData feat(s3-deployment): support \Fn::FindInMap in deploy-time values for Source.jsonData Apr 17, 2025
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: a0048fe
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@arvchahal
Copy link
Author

Clarification Request: We are unsure why this change fails integration tests despite having an integration test in our build which works

@aws-cdk-automation aws-cdk-automation added the pr/reviewer-clarification-requested The contributor has requested clarification on feedback, a failing build, or a failing PR Linter run label Apr 18, 2025
@paulhcsun
Copy link
Contributor

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.

@paulhcsun paulhcsun removed the pr/reviewer-clarification-requested The contributor has requested clarification on feedback, a failing build, or a failing PR Linter run label May 6, 2025
@aws-cdk-automation
Copy link
Collaborator

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:

  • Resume work on the PR
  • OR request an exemption by adding a comment containing 'Exemption Request' with justification e.x "Exemption Request: "
  • OR request clarification by adding a comment containing 'Clarification Request' with a question e.x "Clarification Request: "

This PR will automatically close in 14 days if no action is taken.

@aws-cdk-automation
Copy link
Collaborator

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.

@aws-cdk-automation aws-cdk-automation added the closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. label May 23, 2025
Copy link
Contributor

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 23, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

aws-s3-deployment: Support CfnMapping (Fn::FindInMap) in deploy time values for Source.jsonData
3 participants