-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
feat(core): automatic cross stack, cross region references (under feature flag) #22008
Merged
Commits on Sep 12, 2022
-
feat(core): automatic cross stack, cross region references
This PR adds the ability to automatically create references in cross-region stacks. You can now do something like ```ts const stack1 = new Stack(app, 'Stack1', { env: { region: 'us-east-1' } }); const cert = new certificatemanager.Certificate(stack1, 'Cert', {...}); const stack2 = new Stack(app, 'Stack2', { env: { region: 'us-east-2' } }); new cloudfront.Distribution(stack2, 'Distro', { certificate: cert, }) ``` To accomplish this, I've added a new construct `ExportsReader` which creates a Lambda backed custom resource. This custom resource will return all of the CloudFormation exports in a given region. Given the above example, this would create an output in `stack1` ```json { "Outputs": { "ExportsOutputRefCert5C9FAEC110AE5C6A": { "Value": { "Ref": "Cert5C9FAEC1" }, "Export": { "Name": "East1:ExportsOutputRefCert5C9FAEC110AE5C6A" } } } } ``` And then an "import" in `stack2` which references the `ExportReader` ```json { "Resources": { "Distro87EBE6BA": { "Type": "AWS::CloudFront::Distribution", "Properties": { "DistributionConfig": { "ViewerCertificate": { "AcmCertificateArn": { "Fn::GetAtt": [ "ExportsReaderuseast1D746CBDB", "East1:ExportsOutputRefCert5C9FAEC110AE5C6A" ] } } } } } } ``` Currently this will create a single ExportsReader per region, but we could potentially update this to just use a single ExportsReader which can list exports from a list of regions. Future extensions: - Could be updated to do cross account references as well - Could be used to implement weak references
Configuration menu - View commit details
-
Copy full SHA for 7f47baa - Browse repository at this point
Copy the full SHA 7f47baaView commit details
Commits on Sep 13, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 4ce8290 - Browse repository at this point
Copy the full SHA 4ce8290View commit details
Commits on Sep 14, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 97416cc - Browse repository at this point
Copy the full SHA 97416ccView commit details -
Configuration menu - View commit details
-
Copy full SHA for cfcdd08 - Browse repository at this point
Copy the full SHA cfcdd08View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7a31868 - Browse repository at this point
Copy the full SHA 7a31868View commit details -
Configuration menu - View commit details
-
Copy full SHA for b54bd80 - Browse repository at this point
Copy the full SHA b54bd80View commit details
Commits on Sep 15, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 80f4092 - Browse repository at this point
Copy the full SHA 80f4092View commit details
Commits on Sep 23, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 783cb02 - Browse repository at this point
Copy the full SHA 783cb02View commit details -
Configuration menu - View commit details
-
Copy full SHA for 104a249 - Browse repository at this point
Copy the full SHA 104a249View commit details -
Configuration menu - View commit details
-
Copy full SHA for 49944e6 - Browse repository at this point
Copy the full SHA 49944e6View commit details -
Configuration menu - View commit details
-
Copy full SHA for a4ac262 - Browse repository at this point
Copy the full SHA a4ac262View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3f99d97 - Browse repository at this point
Copy the full SHA 3f99d97View commit details -
Configuration menu - View commit details
-
Copy full SHA for 13b831b - Browse repository at this point
Copy the full SHA 13b831bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 38c4226 - Browse repository at this point
Copy the full SHA 38c4226View commit details
Commits on Sep 26, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 56b4fe6 - Browse repository at this point
Copy the full SHA 56b4fe6View commit details
Commits on Sep 27, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 5160273 - Browse repository at this point
Copy the full SHA 5160273View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1933290 - Browse repository at this point
Copy the full SHA 1933290View commit details -
Configuration menu - View commit details
-
Copy full SHA for 472c337 - Browse repository at this point
Copy the full SHA 472c337View commit details
Commits on Sep 30, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 308cb1b - Browse repository at this point
Copy the full SHA 308cb1bView commit details -
Configuration menu - View commit details
-
Copy full SHA for b02046d - Browse repository at this point
Copy the full SHA b02046dView commit details -
Configuration menu - View commit details
-
Copy full SHA for b833df2 - Browse repository at this point
Copy the full SHA b833df2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 954e005 - Browse repository at this point
Copy the full SHA 954e005View commit details -
Configuration menu - View commit details
-
Copy full SHA for a58b1e7 - Browse repository at this point
Copy the full SHA a58b1e7View commit details -
Configuration menu - View commit details
-
Copy full SHA for d702e0f - Browse repository at this point
Copy the full SHA d702e0fView commit details
Commits on Oct 3, 2022
-
Configuration menu - View commit details
-
Copy full SHA for f9cbab7 - Browse repository at this point
Copy the full SHA f9cbab7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3a1c86b - Browse repository at this point
Copy the full SHA 3a1c86bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 38b6779 - Browse repository at this point
Copy the full SHA 38b6779View commit details
Commits on Oct 12, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 2c1a37b - Browse repository at this point
Copy the full SHA 2c1a37bView commit details
Commits on Oct 13, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 500ea0c - Browse repository at this point
Copy the full SHA 500ea0cView commit details -
updates based on review comments
- moving feature flag to stack property - renaming some things
Configuration menu - View commit details
-
Copy full SHA for 7ffd80b - Browse repository at this point
Copy the full SHA 7ffd80bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5fe1d7b - Browse repository at this point
Copy the full SHA 5fe1d7bView commit details
Commits on Oct 20, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 01f3366 - Browse repository at this point
Copy the full SHA 01f3366View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9e1c2dc - Browse repository at this point
Copy the full SHA 9e1c2dcView commit details
Commits on Oct 28, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 6b9660d - Browse repository at this point
Copy the full SHA 6b9660dView commit details
Commits on Oct 31, 2022
-
Configuration menu - View commit details
-
Copy full SHA for fdea663 - Browse repository at this point
Copy the full SHA fdea663View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3c1f2ff - Browse repository at this point
Copy the full SHA 3c1f2ffView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6197448 - Browse repository at this point
Copy the full SHA 6197448View commit details
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.