ecr: enable enhanced image scanning
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 4.6k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 74
Description
### Describe the feature
Add CDK methods to enable enhanced image scanning for ECR repositories
https://docs.aws.amazon.com/AmazonECR/latest/userguide/image-scanning-enhanced.html
### Use Case
I would like to enable enhanced image scanning through CDK. The alternative route right now is to create a CFN stack using custom resources that invoke the AWS SDK.
### Proposed Solution
Enabling enhanced image scanning is account wide, so updating the [ImageScanningConfiguration Interface](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecr.CfnRepository.ImageScanningConfigurationProperty.html), which applies to a single repository, doesn't make much sense.
Instead, an ideal solution would be a top level method of `aws_ecr`, maybe something like:
```js
import * as ecr from 'aws-cdk-lib/aws-ecr';
...
ecr.EnableEnhancedImageScanning( {
scanOnPush: true,
filters: "*",
});
```
### Other Information
_No response_
### Acknowledgements
- [X] I may be able to implement this feature request
- [X] This feature might incur a breaking change
### CDK version used
v2
### Environment details (OS name and version, etc.)
macOS 13.4
Contributor guide
Research direction
Start with the aws_ecr entry point and the referenced CfnRepository.ImageScanningConfigurationProperty interface, then read the linked AWS enhanced image-scanning documentation. Clarify the account-wide CDK API and verify that the requested scan-on-push and filter behavior can be represented; done means enhanced scanning can be enabled through CDK rather than a custom-resource stack.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, typescript
- Domain
- cloud, infrastructure
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100