Skip to content
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

fix: update the CDK bootstrap template to the latest version #802

Merged
merged 2 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/DetectCDKBootstrapVersionChanges.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,24 @@ jobs:
- name: Install AWS CDK
run: |
npm install -g aws-cdk
- name: Get Staging Bucket Update/Replace Policy
id: stagingBucketUpdateReplacePolicy
run: |
echo "::set-output name=update-replace-policy::$(yq '.Resources.StagingBucket.UpdateReplacePolicy' 'src/AWS.Deploy.Orchestration/CDK/CDKBootstrapTemplate.yaml')"
- name: Get Staging Bucket Deletion Policy
id: stagingBucketDeletionPolicy
run: |
echo "::set-output name=deletion-policy::$(yq '.Resources.StagingBucket.DeletionPolicy' 'src/AWS.Deploy.Orchestration/CDK/CDKBootstrapTemplate.yaml')"
- name: Fail If Update/Replace Policy Not 'Delete'
if: steps.stagingBucketUpdateReplacePolicy.outputs.update-replace-policy != 'Delete'
run: |
echo "The 'UpdateReplacePolicy' of the 'StaginBucket' in the CDK bootstrap template should be 'Delete'."
exit 1
- name: Fail If Deletion Policy Not 'Delete'
if: steps.stagingBucketDeletionPolicy.outputs.deletion-policy != 'Delete'
run: |
echo "The 'DeletionPolicy' of the 'StaginBucket' in the CDK bootstrap template should be 'Delete'."
exit 1
- name: Save New CDK Bootstrap Template
run: |
cdk bootstrap --show-template > newTemplate.yml
Expand Down
6 changes: 3 additions & 3 deletions src/AWS.Deploy.Orchestration/CDK/CDKBootstrapTemplate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ Resources:
Status: Enabled
NoncurrentVersionExpiration:
NoncurrentDays: 365
UpdateReplacePolicy: Retain
DeletionPolicy: Retain
UpdateReplacePolicy: Delete
DeletionPolicy: Delete
StagingBucketPolicy:
Type: AWS::S3::BucketPolicy
Properties:
Expand Down Expand Up @@ -584,7 +584,7 @@ Resources:
Type: String
Name:
Fn::Sub: /cdk-bootstrap/${Qualifier}/version
Value: "18"
Value: "19"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If 207+208 is from us, did CDK not actually change anything 18 -> 19?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it's weird. They only updated the version number.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, okay. Looks like they're made and then reverted two different changes recently: https://github.com/aws/aws-cdk/commits/main/packages/aws-cdk/lib/api/bootstrap/bootstrap-template.yaml

Outputs:
BucketName:
Description: The name of the S3 bucket owned by the CDK toolkit stack
Expand Down