Skip to content

Commit

Permalink
feat(app-staging-synthesizer): enable tag immutability (#26656)
Browse files Browse the repository at this point in the history
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*
  • Loading branch information
tenjaa authored Aug 17, 2023
1 parent a68f7d7 commit 0bcc4b4
Show file tree
Hide file tree
Showing 3 changed files with 131 additions and 126 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@ export class DefaultStagingStack extends Stack implements IStagingResources {
if (this.stagingRepos[asset.assetName] === undefined) {
this.stagingRepos[asset.assetName] = new ecr.Repository(this, repoName, {
repositoryName: repoName,
imageTagMutability: ecr.TagMutability.IMMUTABLE,
lifecycleRules: [{
description: 'Garbage collect old image versions',
maxImageCount: this.props.imageAssetVersionCount ?? 3,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,7 @@
"defaultresourcesmaxecrasset13112F7F9": {
"Type": "AWS::ECR::Repository",
"Properties": {
"ImageTagMutability": "IMMUTABLE",
"LifecyclePolicy": {
"LifecyclePolicyText": "{\"rules\":[{\"rulePriority\":1,\"description\":\"Garbage collect old image versions\",\"selection\":{\"tagStatus\":\"any\",\"countType\":\"imageCountMoreThan\",\"countNumber\":3},\"action\":{\"type\":\"expire\"}}]}"
},
Expand Down Expand Up @@ -693,6 +694,7 @@
"defaultresourcesmaxecrasset2904B88A7": {
"Type": "AWS::ECR::Repository",
"Properties": {
"ImageTagMutability": "IMMUTABLE",
"LifecyclePolicy": {
"LifecyclePolicyText": "{\"rules\":[{\"rulePriority\":1,\"description\":\"Garbage collect old image versions\",\"selection\":{\"tagStatus\":\"any\",\"countType\":\"imageCountMoreThan\",\"countNumber\":3},\"action\":{\"type\":\"expire\"}}]}"
},
Expand Down
Loading

0 comments on commit 0bcc4b4

Please sign in to comment.