# EncryptionAtRestOptionsProperty

Whether the domain should encrypt data at rest, and if so, the AWS Key Management Service key to use.

- Source: Generated at build time
- Type last changed: v2.276.0 · 10 Nov 2026

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_opensearchservice as opensearchservice } from 'aws-cdk-lib';
const encryptionAtRestOptionsProperty: opensearchservice.CfnDomain.EncryptionAtRestOptionsProperty = {
  enabled: false,
  encryptionMode: 'encryptionMode',
  kmsKeyId: 'kmsKeyId',
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_opensearchservice as opensearchservice

encryption_at_rest_options_property = opensearchservice.CfnDomain.EncryptionAtRestOptionsProperty(
    enabled=False,
    encryption_mode="encryptionMode",
    kms_key_id="kmsKeyId"
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.opensearchservice.*;

EncryptionAtRestOptionsProperty encryptionAtRestOptionsProperty = EncryptionAtRestOptionsProperty.builder()
        .enabled(false)
        .encryptionMode("encryptionMode")
        .kmsKeyId("kmsKeyId")
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.OpenSearchService;

var encryptionAtRestOptionsProperty = new EncryptionAtRestOptionsProperty {
    Enabled = false,
    EncryptionMode = "encryptionMode",
    KmsKeyId = "kmsKeyId"
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

encryptionAtRestOptionsProperty := &EncryptionAtRestOptionsProperty{
	Enabled: jsii.Boolean(false),
	EncryptionMode: jsii.String("encryptionMode"),
	KmsKeyId: jsii.String("kmsKeyId"),
}
```

## Properties

- `enabled`: boolean | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) — Specify `true` to enable encryption at rest. Required if you enable fine-grained access control in [AdvancedSecurityOptionsInput](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opensearchservice-domain-advancedsecurityoptionsinput.html) .

  If no encryption at rest options were initially specified in the template, updating this property by adding it causes no interruption. However, if you change this property after it's already been set within a template, the domain is deleted and recreated in order to modify the property.

- `encryptionMode`: string — The type of encryption at rest applied to the domain's data.

  Valid values are DISK and NATIVE. DISK is the default and uses volume-level encryption. NATIVE uses engine-native, index-level encryption and requires encryption at rest to be enabled and OpenSearch version 3.3 or later. After the mode is set to NATIVE, it can't be changed back to DISK.

- `kmsKeyId`: string — The KMS key ID. Takes the form `1a2a3a4-1a2a-3a4a-5a6a-1a2a3a4a5a6a` . Required if you enable encryption at rest.

  You can also use `keyAlias` as a value.

  If no encryption at rest options were initially specified in the template, updating this property by adding it causes no interruption. However, if you change this property after it's already been set within a template, the domain is deleted and recreated in order to modify the property.
