# RepositoryEncryption

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).

Obtainable from: RepositoryEncryption.AES_256, RepositoryEncryption.KMS, RepositoryEncryption.KMS_DSSE

- Source: [`aws-ecr/lib/repository.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/aws-cdk-lib/aws-ecr/lib/repository.ts#L1221)
- Type last changed: v2.182.0 · 5 Mar 2025

## Example

TypeScript:

```ts
new ecr.Repository(this, 'Repo', {
  encryption: ecr.RepositoryEncryption.KMS
});
```

Python:

```python
ecr.Repository(self, "Repo",
    encryption=ecr.RepositoryEncryption.KMS
)
```

Java:

```java
Repository.Builder.create(this, "Repo")
        .encryption(RepositoryEncryption.KMS)
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
new Repository(this, "Repo", new RepositoryProps {
    Encryption = RepositoryEncryption.KMS
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
ecr.NewRepository(this, jsii.String("Repo"), &RepositoryProps{
	Encryption: ecr.RepositoryEncryption_KMS(),
})
```

## Properties

- `AES_256`: [RepositoryEncryption](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecr.RepositoryEncryption.html) (static) — 'AES256'.

- `KMS`: [RepositoryEncryption](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecr.RepositoryEncryption.html) (static) — 'KMS'.

- `KMS_DSSE`: [RepositoryEncryption](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecr.RepositoryEncryption.html) (static) — 'KMS_DSSE'.

- `value`: string — the string value of the encryption.
