Skip to content

feat(aws-ecr): support encryptionConfiguration for repository#15571

Closed
nohack wants to merge 1 commit intoaws:masterfrom
nohack:feat-ecr-encryptionconfig
Closed

feat(aws-ecr): support encryptionConfiguration for repository#15571
nohack wants to merge 1 commit intoaws:masterfrom
nohack:feat-ecr-encryptionconfig

Conversation

@nohack
Copy link
Copy Markdown
Contributor

@nohack nohack commented Jul 15, 2021

Closes #15400

@gitpod-io
Copy link
Copy Markdown

gitpod-io bot commented Jul 15, 2021

@aws-cdk-automation
Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject89A8053A-LhjRyN9kxr8o
  • Commit ID: b49501f
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@peterwoodworth peterwoodworth added the @aws-cdk/aws-ecr Related to Amazon Elastic Container Registry label Jul 20, 2021
mergify bot pushed a commit that referenced this pull request Jan 31, 2022
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*
@madeline-k madeline-k closed this Feb 1, 2022
TikiTDO pushed a commit to TikiTDO/aws-cdk that referenced this pull request Feb 21, 2022
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*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

@aws-cdk/aws-ecr Related to Amazon Elastic Container Registry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(aws-ecr): Repository construct is missing EncryptionConfiguration

4 participants