fix(appconfig): deployment recreated on every cdk deployment#28782
fix(appconfig): deployment recreated on every cdk deployment#28782mergify[bot] merged 4 commits intoaws:mainfrom corymhall:corymhall/fix-appconfig-deployment
Conversation
Every time I perform a CDK deployment, the logicalId hash of the deployment resource changes and causes the deployment resource to be deleted and recreated. I'm assuming it is because the configuration `content` is part of the hash creation and I am creating the content using `lazy` and at the time of the hash creation it is still a token. Looking at the [CloudFormation docs](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appconfig-deployment.html) for the deployment resource, a change to _any_ property causes a replacement so I don't think we need to control the recreation logic ourselves, we should just let CloudFormation do the resource replacement for us.
aws-cdk-automation
left a comment
There was a problem hiding this comment.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.
|
Exemption Request. I re-ran the integ tests to update the snapshots. |
|
We're going to have @chenjane-dev look at this one and give a first review |
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
| public deploy(environment: IEnvironment) { | ||
| const logicalId = `Deployment${this.getDeploymentHash(environment)}`; | ||
| new CfnDeployment(this, logicalId, { | ||
| new CfnDeployment(this, `Deployment${environment.name!}`, { |
There was a problem hiding this comment.
Thanks for doing this! One small change - can we hash the environment name instead of appending the name itself to the logical id? This might look better for reading the logical id's in the template.
new CfnDeployment(this, `Deployment${getHash(environment.name!)}`
There was a problem hiding this comment.
yeah that makes sense, updated!
|
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). |
|
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). |
1 similar comment
|
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). |
|
@kaizencc it looks like something is wrong with mergify. |
Pull request has been modified.
|
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). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Every time I perform a CDK deployment, the logicalId hash of the deployment resource changes and causes the deployment resource to be deleted and recreated. I'm assuming it is because the configuration `content` is part of the hash creation and I am creating the content using `lazy` and at the time of the hash creation it is still a token. Looking at the [CloudFormation docs](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appconfig-deployment.html) for the deployment resource, a change to _any_ property causes a replacement so I don't think we need to control the recreation logic ourselves, we should just let CloudFormation do the resource replacement for us. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Every time I perform a CDK deployment, the logicalId hash of the deployment resource changes and causes the deployment resource to be deleted and recreated. I'm assuming it is because the configuration
contentis part of the hash creation and I am creating the content usinglazyand at the time of the hash creation it is still a token.Looking at the CloudFormation
docs for the deployment resource, a change to any property causes a replacement so I don't think we need to control the recreation logic ourselves, we should just let CloudFormation do the resource replacement for us.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license