Describe the feature
The AWS CDK should support building and publishing all relevant assets from all selected stacks before it deploys anything.
Use Case
When deploying more than one stack at a time, and when these stacks contain docker image assets, docker build can happen after you've already deployed a few stacks. But, docker build can fail for many reasons, including unexpected rate limiting. When this happens, the CDK will deploy some stacks but not all. The CDK could prevent this failure state if it built and published all relevant assets before it deployed anything with CloudFormation.
Proposed Solution
Publishing could be performed before
|
for (const stack of stacks.stackArtifacts) { |
.
Most of the code needed is already in CloudFormationDeployments.publishStackAssets:
|
private async publishStackAssets(stack: cxapi.CloudFormationStackArtifact, toolkitInfo: ToolkitInfo) { |
Other Information
I've opened a PR with the relevant changes to enable this behaviour. #21513
Acknowledgements
CDK version used
2.35.0
Environment details (OS name and version, etc.)
Linux
Describe the feature
The AWS CDK should support building and publishing all relevant assets from all selected stacks before it deploys anything.
Use Case
When deploying more than one stack at a time, and when these stacks contain docker image assets,
docker buildcan happen after you've already deployed a few stacks. But,docker buildcan fail for many reasons, including unexpected rate limiting. When this happens, the CDK will deploy some stacks but not all. The CDK could prevent this failure state if it built and published all relevant assets before it deployed anything with CloudFormation.Proposed Solution
Publishing could be performed before
aws-cdk/packages/aws-cdk/lib/cdk-toolkit.ts
Line 169 in 220177f
Most of the code needed is already in
CloudFormationDeployments.publishStackAssets:aws-cdk/packages/aws-cdk/lib/api/cloudformation-deployments.ts
Line 452 in 74318c7
Other Information
I've opened a PR with the relevant changes to enable this behaviour. #21513
Acknowledgements
CDK version used
2.35.0
Environment details (OS name and version, etc.)
Linux