Skip to content

Commit

Permalink
fix(ecr): Generate valid CloudFormation for imageScanOnPush (aws#13420)
Browse files Browse the repository at this point in the history
fix aws#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*
  • Loading branch information
cplee authored and cornerwings committed Mar 8, 2021
1 parent e6f45f2 commit 0979ea4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-ecr/lib/repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ export class Repository extends RepositoryBase {
repositoryPolicyText: Lazy.any({ produce: () => this.policyDocument }),
lifecyclePolicy: Lazy.any({ produce: () => this.renderLifecyclePolicy() }),
imageScanningConfiguration: !props.imageScanOnPush ? undefined : {
scanOnPush: true,
ScanOnPush: true,
},
});

Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-ecr/test/integ.imagescan.expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"Type": "AWS::ECR::Repository",
"Properties": {
"ImageScanningConfiguration": {
"scanOnPush": true
"ScanOnPush": true
}
},
"UpdateReplacePolicy": "Delete",
Expand Down Expand Up @@ -87,4 +87,4 @@
}
}
}
}
}
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-ecr/test/test.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export = {
// THEN
expect(stack).to(haveResource('AWS::ECR::Repository', {
ImageScanningConfiguration: {
scanOnPush: true,
ScanOnPush: true,
},
}));
test.done();
Expand Down

0 comments on commit 0979ea4

Please sign in to comment.