Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: new synthesizer separates assets out per CDK application (#24430)
This PR introduces a new synthesizer inside the module `app-staging-synthesizer-alpha`. This new synthesizer produces staging resources alongside the CDK application and assets will be stored there. It removes the need for running `cdk bootstrap` before deploying a CDK app in a new account/region. Under the new synthesizer, assets between different CDK applications will be separated which means they can be cleaned up and lifecycle controlled independently. To get started, add the following to your CDK application: ```ts const app = new App({ defaultStackSynthesizer: AppStagingSynthesizer.defaultResources({ appId: 'my-app-id', // put a unique id here }), }); ``` The new format of staging resources will look something like this: ```text ┌─────────────────────────────┐┌───────────────────────────────────────┐┌───────────────────────────────────────┐ │ ││ ││ │ │ ┌───────────────┐ ││ ┌──────────────┐ ││ ┌──────────────┐ │ │ │Bootstrap Stack│ ││ │ CDK App 1 │ ││ │ CDK App 2 │ │ │ └───────────────┘ ││ └──────────────┘ ││ └──────────────┘ │ │ ││┌──────────────────┐ ││┌──────────────────┐ │ │ │││ ┌──────────────┐ │ │││ ┌──────────────┐ │ │ │ │││ │Staging Stack │ │ │││ │Staging Stack │ │ │ │ │││ └──────────────┘ │ │││ └──────────────┘ │ │ │ │││ │ │││ │ │ │ │││ │ │││ │ │ │ │││┌────────────────┐│ ┌────────────┐│││┌────────────────┐│ ┌────────────┐│ │ ││││ IAM Role for ││ ┌───│ S3 Asset │││││ IAM Role for ││ ┌───│ S3 Asset ││ │ ││││File Publishing ││ │ └────────────┘││││File Publishing ││ │ └────────────┘│ │ │││└────────────────┘│ │ ││││ IAM Role for ││ │ │ │ │││ │ │ ││││Image Publishing││ │ │ │┌───────────────────────────┐│││ │ │ │││└────────────────┘│ │ │ ││IAM Role for CFN execution ││││ │ │ │││ │ │ │ ││ IAM Role for lookup ││││ │ │ │││ │ │ │ ││ IAM Role for deployment ││││┌────────────────┐│ │ │││┌────────────────┐│ │ │ │└───────────────────────────┘││││ S3 Bucket for ││ │ ││││ S3 Bucket for ││ │ │ │ ││││ Staging Assets │◀─┘ ││││ Staging Assets │◀─┘ │ │ │││└────────────────┘│ │││└────────────────┘│ ┌───────────┐│ │ │││ │ │││ │ ┌───│ ECR Asset ││ │ │││ │ │││┌────────────────┐│ │ └───────────┘│ │ │││ │ ││││ ECR Repository ││ │ │ │ │││ │ ││││ for Staging │◀──┘ │ │ │││ │ ││││ Assets ││ │ │ │││ │ │││└────────────────┘│ │ │ │││ │ │││ │ │ │ │││ │ │││ │ │ │ │││ │ │││ │ │ │ │││ │ │││ │ │ │ │││ │ │││ │ │ │ ││└──────────────────┘ ││└──────────────────┘ │ └─────────────────────────────┘└───────────────────────────────────────┘└───────────────────────────────────────┘ ``` This feature is heavily experimental and the API may break in the future. It does not work with CDK Pipelines yet. Depended on #25536. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
- Loading branch information