Skip to content
v2.277.0

RepositoryEncryption Class ​

Indicates whether server-side encryption is enabled for the object, and whether that encryption is from the AWS Key Management Service (AWS KMS) or from Amazon S3 managed encryption (SSE-S3).

Example ​

ts
new ecr.Repository(this, 'Repo', {
  encryption: ecr.RepositoryEncryption.KMS
});
python
ecr.Repository(self, "Repo",
    encryption=ecr.RepositoryEncryption.KMS
)
java
Repository.Builder.create(this, "Repo")
        .encryption(RepositoryEncryption.KMS)
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
new Repository(this, "Repo", new RepositoryProps {
    Encryption = RepositoryEncryption.KMS
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
ecr.NewRepository(this, jsii.String("Repo"), &RepositoryProps{
	Encryption: ecr.RepositoryEncryption_KMS(),
})

Properties ​

valuestringvaluestrvalueStringValuestringValue*string#
the string value of the encryption.