-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(aws-ecr): Repository construct is missing EncryptionConfiguration #15400
Comments
Agreed this would be a great feature to add! @nikovirtala I am triaging this as a p2, which means the CDK team will not be able to prioritize it right now. But we always welcome contributions! Check out the contributing guide for instructions on how to submit a PR. |
@madeline-k created a pr for this.thanks. |
fixes #15400 With this request you will be able to configure the encryption of your ECR Repository. Before this patch you need to use a L1-Construct and add it via: Python: ```python repo = ecr.Repository(stack, 'Repo') cfn_repo = repo.node.default_child cfn_repo.encryption_configuration = CfnRepository.EncryptionConfigurationProperty(encryption_type="KMS") ``` Now this becomes: ```python repo = ecr.Repository(stack, 'Repo', encryption_type=ecr.RepositoryEncryption.KMS) ``` When using a KMS Key, the `encryption_type` is set automatically to `KMS`. ```python kms_key = kms.Key(stack, 'Key') ecr.Repository(stack, 'Repo', encryption_key=kms_key) ``` Similar to #15571 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
fixes aws#15400 With this request you will be able to configure the encryption of your ECR Repository. Before this patch you need to use a L1-Construct and add it via: Python: ```python repo = ecr.Repository(stack, 'Repo') cfn_repo = repo.node.default_child cfn_repo.encryption_configuration = CfnRepository.EncryptionConfigurationProperty(encryption_type="KMS") ``` Now this becomes: ```python repo = ecr.Repository(stack, 'Repo', encryption_type=ecr.RepositoryEncryption.KMS) ``` When using a KMS Key, the `encryption_type` is set automatically to `KMS`. ```python kms_key = kms.Key(stack, 'Key') ecr.Repository(stack, 'Repo', encryption_key=kms_key) ``` Similar to aws#15571 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Add missing EncryptionConfiguration to the ECR Repository construct.
Use Case
I want to be able to encrypt the container images stored to ECR with a KMS customer managed key (CMK).
Proposed Solution
Add missing EncryptionConfiguration to the ECR Repository construct.
Other
This feature has been available on ECR since July 2020:
CloudFormation, as well as the CDK L1 construct, supports it:
You can work around this with an escape hatch, but it should not be necessary.
This is a 🚀 Feature Request
The text was updated successfully, but these errors were encountered: