-
Notifications
You must be signed in to change notification settings - Fork 4.4k
fix(codepipeline): allow re-deploying the pipeline stack after cdk destroy
#4400
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
Conversation
Currently, the KMS key and alias used for the default CodePipeline artifact bucket are created with RemovalPolicy.RETAIN. That is problematic when trying to re-deploy a stack after running `cdk destroy`, as the alias name will already be taken. Because of that, change the removal policy of both the key and the alias to RemovalPolicy.DESTROY - there is a grace period of a few days on the key before it's removed permanently, so that should be good enough if anyone needs it, and it doesn't seem like directly reading the artifacts of the pipeline is an important use case anyway, especially after it has been deleted. Fixes aws#4336
|
Thanks so much for taking the time to contribute to the AWS CDK ❤️ We will shortly assign someone to review this pull request and help get it
|
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
eladb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about the bucket(s)? If we destroy the keys, there is no reason to keep the buckets, right?
Also:
- PR title for bugs should describe the problem, not the solution
- Please reformat the PR description (line breaks, capitazliation, backpacks, etc)
cdk destroy
Unfortunately, we can't destroy the buckets, as that will fail if they're not empty, and require a manual intervention by the user. Like I said, the keys are still available for a few days, so if for some reason you want to read the artifacts, the key will be there (and you can always opt-out of the key deletion in the console if you need to keep it for longer). Anyway, based on my experience working on the
Done. |
|
Thank you for contributing! Your pull request is now being automatically merged. |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Currently, the KMS key and alias used for the default CodePipeline artifact bucket are created with
RemovalPolicy.RETAIN. That is problematic when trying to re-deploy a stack after runningcdk destroy, as the alias name will already be taken. Because of that, change the removal policy of both the key and the alias toRemovalPolicy.DESTROY- there is a grace period of a few days on the key before it's removed permanently, so that should be good enough if anyone needs it, and it doesn't seem like directly reading the artifacts of the pipeline is an important use case anyway, especially after it has been deleted.Fixes #4336
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license