File tree Expand file tree Collapse file tree 4 files changed +35
-0
lines changed Expand file tree Collapse file tree 4 files changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -201,6 +201,16 @@ parameters:
201
201
The alias, key ID, or full ARN of the KMS key can be specified.
202
202
default : " "
203
203
204
+ repo_image_tag_mutability :
205
+ type : enum
206
+ enum : ["MUTABLE", "IMMUTABLE"]
207
+ description : >
208
+ The tag mutability setting for the repository. If this parameter is omitted,
209
+ the default setting of MUTABLE will be used which will allow image tags to be
210
+ overwritten. If IMMUTABLE is specified, all image tags within the repository will
211
+ be immutable which will prevent them from being overwritten.
212
+ default : " MUTABLE"
213
+
204
214
use_credentials_helper :
205
215
type : boolean
206
216
default : true
@@ -248,6 +258,7 @@ steps:
248
258
public_registry : <<parameters.public_registry>>
249
259
repo_encryption_type : <<parameters.repo_encryption_type>>
250
260
encryption_kms_key : <<parameters.repo_encryption_kms_key>>
261
+ image_tag_mutability : <<parameters.repo_image_tag_mutability>>
251
262
- when :
252
263
condition : <<parameters.set_repo_policy>>
253
264
steps :
Original file line number Diff line number Diff line change @@ -41,6 +41,16 @@ parameters:
41
41
The alias, key ID, or full ARN of the KMS key can be specified.
42
42
default : " "
43
43
44
+ image_tag_mutability :
45
+ type : enum
46
+ enum : ["MUTABLE", "IMMUTABLE"]
47
+ description : >
48
+ The tag mutability setting for the repository. If this parameter is omitted,
49
+ the default setting of MUTABLE will be used which will allow image tags to be
50
+ overwritten. If IMMUTABLE is specified, all image tags within the repository will
51
+ be immutable which will prevent them from being overwritten.
52
+ default : " MUTABLE"
53
+
44
54
steps :
45
55
- run :
46
56
name : Create Repository
52
62
AWS_ECR_BOOL_PUBLIC_REGISTRY : <<parameters.public_registry>>
53
63
AWS_ECR_ENUM_ENCRYPTION_TYPE : <<parameters.repo_encryption_type>>
54
64
AWS_ECR_STR_ENCRYPTION_KMS_KEY : <<parameters.encryption_kms_key>>
65
+ AWS_ECR_STR_IMAGE_TAG_MUTABILITY : <<parameters.image_tag_mutability>>
55
66
command : <<include(scripts/create_repo.sh)>>
Original file line number Diff line number Diff line change @@ -199,6 +199,16 @@ parameters:
199
199
The alias, key ID, or full ARN of the KMS key can be specified.
200
200
default : " "
201
201
202
+ repo_image_tag_mutability :
203
+ type : enum
204
+ enum : ["MUTABLE", "IMMUTABLE"]
205
+ description : >
206
+ The tag mutability setting for the repository. If this parameter is omitted,
207
+ the default setting of MUTABLE will be used which will allow image tags to be
208
+ overwritten. If IMMUTABLE is specified, all image tags within the repository will
209
+ be immutable which will prevent them from being overwritten.
210
+ default : " MUTABLE"
211
+
202
212
aws_domain :
203
213
type : string
204
214
default : " amazonaws.com"
@@ -246,5 +256,6 @@ steps:
246
256
auth : <<parameters.auth>>
247
257
repo_encryption_type : <<parameters.repo_encryption_type>>
248
258
repo_encryption_kms_key : <<parameters.repo_encryption_kms_key>>
259
+ repo_image_tag_mutability : <<parameters.repo_image_tag_mutability>>
249
260
use_credentials_helper : <<parameters.use_credentials_helper>>
250
261
aws_domain : <<parameters.aws_domain>>
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ AWS_ECR_EVAL_REGION="$(eval echo "${AWS_ECR_STR_REGION}")"
3
3
AWS_ECR_EVAL_REPO=" $( eval echo " ${AWS_ECR_STR_REPO} " ) "
4
4
AWS_ECR_EVAL_PROFILE_NAME=" $( eval echo " ${AWS_ECR_STR_PROFILE_NAME} " ) "
5
5
AWS_ECR_EVAL_ENCRYPTION_KMS_KEY=" $( eval echo " ${AWS_ECR_STR_ENCRYPTION_KMS_KEY} " ) "
6
+ AWS_ECR_EVAL_IMAGE_TAG_MUTABILITY=" $( eval echo " ${AWS_ECR_STR_IMAGE_TAG_MUTABILITY} " ) "
6
7
7
8
if [ " $AWS_ECR_BOOL_PUBLIC_REGISTRY " == " 1" ]; then
8
9
aws ecr-public describe-repositories --profile " ${AWS_ECR_EVAL_PROFILE_NAME} " --region us-east-1 --repository-names " ${AWS_ECR_EVAL_REPO} " > /dev/null 2>&1 ||
27
28
--profile " ${AWS_ECR_EVAL_PROFILE_NAME} " \
28
29
--region " ${AWS_ECR_EVAL_REGION} " \
29
30
--repository-name " ${AWS_ECR_EVAL_REPO} " \
31
+ --image-tag-mutability " ${AWS_ECR_EVAL_IMAGE_TAG_MUTABILITY} " \
30
32
--image-scanning-configuration " ${IMAGE_SCANNING_CONFIGURATION} " \
31
33
--encryption-configuration " ${ENCRYPTION_CONFIGURATION} "
32
34
fi
You can’t perform that action at this time.
0 commit comments