{{ message }}
Repository navigation
feat(core): add Fn::GetStackOutput for cross-region references - #37724
Merged
Merged
Conversation
Introduces a new feature flag `USE_GET_STACK_OUTPUT` that enables using the CloudFormation intrinsic function `Fn::GetStackOutput` for cross-region stack references instead of custom resources with SSM parameters. When `crossRegionReferences=true` and this flag is enabled, cross-region references are resolved using `Fn::GetStackOutput`, which directly retrieves outputs from other stacks without requiring custom resources. Changes: - Add `Fn.getStackOutput()` method and `FnGetStackOutput` class in cfn-fn.ts - Implement `createGetStackOutput()` in refs.ts to generate outputs and references - Add `USE_GET_STACK_OUTPUT` feature flag with recommended value `true` - Update feature flags documentation and recommended flags configuration - Add test coverage for the new functionality
mrgrain
reviewed
May 1, 2026
mrgrain
requested changes
May 1, 2026
aws-cdk-automation
dismissed
their stale review
May 1, 2026 15:19
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
Contributor
Author
mrgrain
approved these changes
May 1, 2026
Contributor
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Contributor
Merge Queue Status
This pull request spent 29 minutes 37 seconds in the queue, including 29 minutes 19 seconds running CI. Required conditions to merge
|
Contributor
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Contributor
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

By default, the CDK only allows references between resources if they are in the same environment (account and region). But users can opt in to an experimental feature that allows cross-region, same-account references, by setting the
crossRegionReferenceflag totruein the consumer stack. With this feature on, when there is a cross-region reference, the CDK generates two custom resources that communicate with each other via SSM parameters. A writer resource is deployed to the producer stack, and a reader resource is deployed to the consumer stack.So far, this was the best mechanism to "export" a value in the producer and "import" it in the consumer. But CloudFormation has now released a new intrinsic function,
Fn::GetStackOutput, which, as the name suggests, gets the value of a arbitrary output. This function works cross-region and cross-account. This PR introduces support for these two use cases.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license