File tree 4 files changed +32
-6
lines changed
4 files changed +32
-6
lines changed Original file line number Diff line number Diff line change @@ -510,10 +510,11 @@ $ cdk destroy --app='node bin/main.js' MyStackName
510
510
511
511
### ` cdk bootstrap `
512
512
513
- Deploys a ` CDKToolkit ` CloudFormation stack into the specified environment(s), that provides an S3 bucket that
514
- ` cdk deploy ` will use to store synthesized templates and the related assets, before triggering a CloudFormation stack
515
- update. The name of the deployed stack can be configured using the ` --toolkit-stack-name ` argument. The S3 Bucket
516
- Public Access Block Configuration can be configured using the ` --public-access-block-configuration ` argument.
513
+ Deploys a ` CDKToolkit ` CloudFormation stack into the specified environment(s), that provides an S3 bucket
514
+ and ECR reposity that ` cdk deploy ` will use to store synthesized templates and the related assets, before
515
+ triggering a CloudFormation stack update. The name of the deployed stack can be configured using the
516
+ ` --toolkit-stack-name ` argument. The S3 Bucket Public Access Block Configuration can be configured using
517
+ the ` --public-access-block-configuration ` argument. ECR uses immutable tags for images.
517
518
518
519
``` console
519
520
$ # Deploys to all environments
Original file line number Diff line number Diff line change @@ -202,6 +202,7 @@ Resources:
202
202
ContainerAssetsRepository :
203
203
Type : AWS::ECR::Repository
204
204
Properties :
205
+ ImageTagMutability : IMMUTABLE
205
206
ImageScanningConfiguration :
206
207
ScanOnPush : true
207
208
RepositoryName :
@@ -509,7 +510,7 @@ Resources:
509
510
Type : String
510
511
Name :
511
512
Fn::Sub : ' /cdk-bootstrap/${Qualifier}/version'
512
- Value : ' 12 '
513
+ Value : ' 13 '
513
514
Outputs :
514
515
BucketName :
515
516
Description : The name of the S3 bucket owned by the CDK toolkit stack
Original file line number Diff line number Diff line change 13
13
"lint" : " cdk-lint" ,
14
14
"pkglint" : " pkglint -f" ,
15
15
"test" : " cdk-test" ,
16
- "integ" : " jest --testMatch '**/?(*.)+(integ-test ).js'" ,
16
+ "integ" : " jest --testMatch '**/?(*.)+(integtest ).js'" ,
17
17
"package" : " cdk-package" ,
18
18
"build+test+package" : " yarn build+test && yarn package" ,
19
19
"build+test" : " yarn build && yarn test" ,
Original file line number Diff line number Diff line change @@ -252,3 +252,27 @@ integTest('can deploy modern-synthesized stack even if bootstrap stack name is u
252
252
] ,
253
253
} ) ;
254
254
} ) ) ;
255
+
256
+ integTest ( 'create ECR with tag IMMUTABILITY to set on' , withDefaultFixture ( async ( fixture ) => {
257
+ const bootstrapStackName = fixture . bootstrapStackName ;
258
+
259
+ await fixture . cdkBootstrapModern ( {
260
+ verbose : true ,
261
+ toolkitStackName : bootstrapStackName ,
262
+ } ) ;
263
+
264
+ const response = await fixture . aws . cloudFormation ( 'describeStackResources' , {
265
+ StackName : bootstrapStackName ,
266
+ } ) ;
267
+ const ecrResource = response . StackResources ?. find ( resource => resource . LogicalResourceId === 'ContainerAssetsRepository' ) ;
268
+ expect ( ecrResource ) . toBeDefined ( ) ;
269
+
270
+ const ecrResponse = await fixture . aws . ecr ( 'describeRepositories' , {
271
+ repositoryNames : [
272
+ // This is set, as otherwise we don't end up here
273
+ ecrResource ?. PhysicalResourceId ?? '' ,
274
+ ] ,
275
+ } ) ;
276
+
277
+ expect ( ecrResponse . repositories ?. [ 0 ] . imageTagMutability ) . toEqual ( 'IMMUTABLE' ) ;
278
+ } ) ) ;
You can’t perform that action at this time.
0 commit comments