Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(core): inject
TreeMetadata
resource at the end (during synthe…
…sis) (#22780) The `TreeMetadata` resource was being created as part of the `App` constructor, which meant that you could not add any context to the App node (you must add context _before_ any constructs are added). This moves the creation of `TreeMetadata` to be injected during `synthesis` similar to how we currently inject the metadata resource. A side effect of this change is that we will now include tree metadata for resources that are added in `Stack.synthesize()` methods. The [synthesizeTree](https://github.com/aws/aws-cdk/blob/95e9e0f54a1dfb628d5146bd9b69c292547cf090/packages/@aws-cdk/core/lib/private/synthesis.ts#L193-L210) function visits nodes in the order that they were added to the tree. Previously the `TreeMetadata` was the first node so the TreeMetadata was generated first. Then if any Stacks would call `Stack.synthesize()` and add additional constructs (e.g. `BootstrapVersion`) these would not be added to the tree. re #22749 ---- ### All Submissions: * [ ] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
- Loading branch information
Showing
3 changed files
with
68 additions
and
15 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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