Skip to content
v2.278.0

EncryptionAtRestOptions Struct ​

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

Can only be used to create a new domain, not update an existing one. Requires Elasticsearch version 5.1 or later.

Example ​

ts
const domain = new es.Domain(this, 'Domain', {
  version: es.ElasticsearchVersion.V7_1,
  enforceHttps: true,
  nodeToNodeEncryption: true,
  encryptionAtRest: {
    enabled: true,
  },
  fineGrainedAccessControl: {
    masterUserName: 'master-user',
  },
});

const masterUserPassword = domain.masterUserPassword;
python
domain = es.Domain(self, "Domain",
    version=es.ElasticsearchVersion.V7_1,
    enforce_https=True,
    node_to_node_encryption=True,
    encryption_at_rest=es.EncryptionAtRestOptions(
        enabled=True
    ),
    fine_grained_access_control=es.AdvancedSecurityOptions(
        master_user_name="master-user"
    )
)

master_user_password = domain.master_user_password
java
Domain domain = Domain.Builder.create(this, "Domain")
        .version(ElasticsearchVersion.V7_1)
        .enforceHttps(true)
        .nodeToNodeEncryption(true)
        .encryptionAtRest(EncryptionAtRestOptions.builder()
                .enabled(true)
                .build())
        .fineGrainedAccessControl(AdvancedSecurityOptions.builder()
                .masterUserName("master-user")
                .build())
        .build();

SecretValue masterUserPassword = domain.getMasterUserPassword();
csharp
// Install: dotnet add package Amazon.CDK.Lib
var domain = new Domain(this, "Domain", new DomainProps {
    Version = ElasticsearchVersion.V7_1,
    EnforceHttps = true,
    NodeToNodeEncryption = true,
    EncryptionAtRest = new EncryptionAtRestOptions {
        Enabled = true
    },
    FineGrainedAccessControl = new AdvancedSecurityOptions {
        MasterUserName = "master-user"
    }
});

var masterUserPassword = domain.MasterUserPassword;
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
domain := es.NewDomain(this, jsii.String("Domain"), &DomainProps{
	Version: es.ElasticsearchVersion_V7_1(),
	EnforceHttps: jsii.Boolean(true),
	NodeToNodeEncryption: jsii.Boolean(true),
	EncryptionAtRest: &EncryptionAtRestOptions{
		Enabled: jsii.Boolean(true),
	},
	FineGrainedAccessControl: &AdvancedSecurityOptions{
		MasterUserName: jsii.String("master-user"),
	},
})

masterUserPassword := domain.MasterUserPassword

Properties ​

enabledoptionalbooleanenabledoptionalboolenabledoptionalBooleanEnabledoptionalboolEnabledoptional*bool deprecated #
use opensearchservice module instead

Default: encryption at rest is disabled.

kmsKeyoptionalIKeyRefkms_keyoptionalIKeyRefkmsKeyoptionalIKeyRefKmsKeyoptionalIKeyRefKmsKeyoptionalIKeyRef deprecated #
use opensearchservice module instead

Default: uses default aws/es KMS key.