Skip to content

Conversation

arvchahal
Copy link

@arvchahal arvchahal commented Apr 17, 2025

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 static values throughout the template quickly causes size constraints.

By allowing Fn::FindInMap to be used in Source.jsonData, we enable developers to define the mapping once and reference it efficiently. This pattern helps optimize template size and maintainability for dynamic configuration values.

Solves issue

  • 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:36
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:

❌ The title prefix of this pull request must be one of "feat|fix|build|chore|ci|docs|style|refactor|perf|test|revert"
❌ The first word of the pull request title should not be capitalized. If the title starts with a CDK construct, it should be in backticks "``".
❌ Pull requests from `main` branch of a fork cannot be accepted. Please reopen this contribution from another branch on your fork. For more information, see https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md#step-4-pull-request.

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.

@aws-cdk-automation
Copy link
Collaborator

Your pull request must be based off of a branch in a personal account (not an organization owned account, and not the main branch). You must also have the setting enabled that allows the CDK team to push changes to your branch (this setting is enabled by default for personal accounts, and cannot be enabled for organization owned accounts). The reason for this is that our automation needs to synchronize your branch with our main after it has been approved, and we cannot do that if we cannot push to your branch.

@github-actions
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.

@aws-cdk-automation
Copy link
Collaborator

Your pull request must be based off of a branch in a personal account (not an organization owned account, and not the main branch). You must also have the setting enabled that allows the CDK team to push changes to your branch (this setting is enabled by default for personal accounts, and cannot be enabled for organization owned accounts). The reason for this is that our automation needs to synchronize your branch with our main after it has been approved, and we cannot do that if we cannot push to your branch.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 17, 2025
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

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

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

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 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

2 participants