Skip to content

Commit 0bcc4b4

Browse files
authored
feat(app-staging-synthesizer): enable tag immutability (#26656)
Closes #26655 I cannot run the integration tests and therefore cannot update the snapshot :( ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent a68f7d7 commit 0bcc4b4

File tree

3 files changed

+131
-126
lines changed

3 files changed

+131
-126
lines changed

packages/@aws-cdk/app-staging-synthesizer-alpha/lib/default-staging-stack.ts

+1
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,7 @@ export class DefaultStagingStack extends Stack implements IStagingResources {
422422
if (this.stagingRepos[asset.assetName] === undefined) {
423423
this.stagingRepos[asset.assetName] = new ecr.Repository(this, repoName, {
424424
repositoryName: repoName,
425+
imageTagMutability: ecr.TagMutability.IMMUTABLE,
425426
lifecycleRules: [{
426427
description: 'Garbage collect old image versions',
427428
maxImageCount: this.props.imageAssetVersionCount ?? 3,

packages/@aws-cdk/app-staging-synthesizer-alpha/test/integ.synth-default-resources.js.snapshot/StagingStack-default-resourcesmax-ACCOUNT-REGION.template.json

+2
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,7 @@
567567
"defaultresourcesmaxecrasset13112F7F9": {
568568
"Type": "AWS::ECR::Repository",
569569
"Properties": {
570+
"ImageTagMutability": "IMMUTABLE",
570571
"LifecyclePolicy": {
571572
"LifecyclePolicyText": "{\"rules\":[{\"rulePriority\":1,\"description\":\"Garbage collect old image versions\",\"selection\":{\"tagStatus\":\"any\",\"countType\":\"imageCountMoreThan\",\"countNumber\":3},\"action\":{\"type\":\"expire\"}}]}"
572573
},
@@ -693,6 +694,7 @@
693694
"defaultresourcesmaxecrasset2904B88A7": {
694695
"Type": "AWS::ECR::Repository",
695696
"Properties": {
697+
"ImageTagMutability": "IMMUTABLE",
696698
"LifecyclePolicy": {
697699
"LifecyclePolicyText": "{\"rules\":[{\"rulePriority\":1,\"description\":\"Garbage collect old image versions\",\"selection\":{\"tagStatus\":\"any\",\"countType\":\"imageCountMoreThan\",\"countNumber\":3},\"action\":{\"type\":\"expire\"}}]}"
698700
},

0 commit comments

Comments
 (0)