Skip to content

Commit 278fba5

Browse files
authored
fix(ecr): Generate valid CloudFormation for imageScanOnPush (#13420)
fix #13418: Update ECR construct to generate valid CloudFormation when enabling `imageScanOnPush` ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 80b10f8 commit 278fba5

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

packages/@aws-cdk/aws-ecr/lib/repository.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ export class Repository extends RepositoryBase {
450450
repositoryPolicyText: Lazy.any({ produce: () => this.policyDocument }),
451451
lifecyclePolicy: Lazy.any({ produce: () => this.renderLifecyclePolicy() }),
452452
imageScanningConfiguration: !props.imageScanOnPush ? undefined : {
453-
scanOnPush: true,
453+
ScanOnPush: true,
454454
},
455455
});
456456

packages/@aws-cdk/aws-ecr/test/integ.imagescan.expected.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"Type": "AWS::ECR::Repository",
55
"Properties": {
66
"ImageScanningConfiguration": {
7-
"scanOnPush": true
7+
"ScanOnPush": true
88
}
99
},
1010
"UpdateReplacePolicy": "Delete",
@@ -87,4 +87,4 @@
8787
}
8888
}
8989
}
90-
}
90+
}

packages/@aws-cdk/aws-ecr/test/test.repository.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export = {
3838
// THEN
3939
expect(stack).to(haveResource('AWS::ECR::Repository', {
4040
ImageScanningConfiguration: {
41-
scanOnPush: true,
41+
ScanOnPush: true,
4242
},
4343
}));
4444
test.done();

0 commit comments

Comments
 (0)