Skip to content
v2.274.0

Domain L2 construct ​

Provides an Amazon OpenSearch Service domain.

Example ​

ts
const domain = new Domain(this, 'Domain', {
  version: EngineVersion.OPENSEARCH_1_0,
  ebs: {
    volumeSize: 100,
    volumeType: ec2.EbsDeviceVolumeType.GENERAL_PURPOSE_SSD,
  },
  nodeToNodeEncryption: true,
  encryptionAtRest: {
    enabled: true,
  },
});
python
from aws_cdk.aws_opensearchservice import EbsOptions, EncryptionAtRestOptions
domain = Domain(self, "Domain",
    version=EngineVersion.OPENSEARCH_1_0,
    ebs=EbsOptions(
        volume_size=100,
        volume_type=ec2.EbsDeviceVolumeType.GENERAL_PURPOSE_SSD
    ),
    node_to_node_encryption=True,
    encryption_at_rest=EncryptionAtRestOptions(
        enabled=True
    )
)
java
Domain domain = Domain.Builder.create(this, "Domain")
        .version(EngineVersion.OPENSEARCH_1_0)
        .ebs(EbsOptions.builder()
                .volumeSize(100)
                .volumeType(EbsDeviceVolumeType.GENERAL_PURPOSE_SSD)
                .build())
        .nodeToNodeEncryption(true)
        .encryptionAtRest(EncryptionAtRestOptions.builder()
                .enabled(true)
                .build())
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
var domain = new Domain(this, "Domain", new DomainProps {
    Version = EngineVersion.OPENSEARCH_1_0,
    Ebs = new EbsOptions {
        VolumeSize = 100,
        VolumeType = EbsDeviceVolumeType.GENERAL_PURPOSE_SSD
    },
    NodeToNodeEncryption = true,
    EncryptionAtRest = new EncryptionAtRestOptions {
        Enabled = true
    }
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
domain := awscdk.NewDomain(this, jsii.String("Domain"), &DomainProps{
	Version: awscdk.EngineVersion_OPENSEARCH_1_0(),
	Ebs: &EbsOptions{
		VolumeSize: jsii.Number(100),
		VolumeType: ec2.EbsDeviceVolumeType_GENERAL_PURPOSE_SSD,
	},
	NodeToNodeEncryption: jsii.Boolean(true),
	EncryptionAtRest: &EncryptionAtRestOptions{
		Enabled: jsii.Boolean(true),
	},
})

Initializer ​

ts
new Domain(scope: Construct, id: string, props: DomainProps)
python
Domain(scope: Construct, id: str, props: DomainProps)
java
new Domain(Construct scope, String id, DomainProps props)
csharp
new Domain(Construct scope, string id, DomainProps props)
go
NewDomain(Scope Construct, Id *string, Props DomainProps)

Construct Props ​

accessPoliciesPolicyStatement[]access_policiestyping.List[PolicyStatement]accessPoliciesList<PolicyStatement>AccessPoliciesPolicyStatement[]AccessPolicies*[]PolicyStatement= No access policies.#
Domain access policies.
advancedOptions{ [key: string]: string }advanced_optionstyping.Mapping[str, str]advancedOptionsMap<String, String>AdvancedOptionsIDictionary<string, string>AdvancedOptions*map[string]*string= no advanced options are specifie…#
Additional options to specify for the Amazon OpenSearch Service domain.
default

Default: no advanced options are specified

automatedSnapshotStartHournumberautomated_snapshot_start_hourint | floatautomatedSnapshotStartHourNumberAutomatedSnapshotStartHourdoubleAutomatedSnapshotStartHour*float64= Hourly automated snapshots not u…#
The hour in UTC during which the service takes an automated daily snapshot of the indices in the Amazon OpenSearch Service domain.

Only applies for Elasticsearch versions below 5.3.

default

Default: Hourly automated snapshots not used

capacityCapacityConfigcapacityCapacityConfigcapacityCapacityConfigCapacityCapacityConfigCapacityCapacityConfig= 1 r5.large.search data node; no …#
The cluster capacity configuration for the Amazon OpenSearch Service domain.
default

Default: 1 r5.large.search data node; no dedicated master nodes.

cognitoDashboardsAuthCognitoOptionscognito_dashboards_authCognitoOptionscognitoDashboardsAuthCognitoOptionsCognitoDashboardsAuthCognitoOptionsCognitoDashboardsAuthCognitoOptions= Cognito not used for authenticat…#
Configures Amazon OpenSearch Service to use Amazon Cognito authentication for OpenSearch Dashboards.
default

Default: Cognito not used for authentication to OpenSearch Dashboards.

coldStorageEnabledbooleancold_storage_enabledboolcoldStorageEnabledBooleanColdStorageEnabledboolColdStorageEnabled*bool= undefined#
Whether to enable or disable cold storage on the domain.

You must enable UltraWarm storage to enable cold storage.

customEndpointCustomEndpointOptionscustom_endpointCustomEndpointOptionscustomEndpointCustomEndpointOptionsCustomEndpointCustomEndpointOptionsCustomEndpointCustomEndpointOptions= no custom domain endpoint will b…#
To configure a custom domain configure these options.

If you specify a Route53 hosted zone it will create a CNAME record and use DNS validation for the certificate

default

Default: no custom domain endpoint will be configured

domainNamestringdomain_namestrdomainNameStringDomainNamestringDomainName*string= A name will be auto-generated.#
Enforces a particular physical domain name.
ebsEbsOptionsebsEbsOptionsebsEbsOptionsEbsEbsOptionsEbsEbsOptions= 10 GiB General Purpose (SSD) vol…#
The configurations of Amazon Elastic Block Store (Amazon EBS) volumes that are attached to data nodes in the Amazon OpenSearch Service domain.
default

Default: 10 GiB General Purpose (SSD) volumes per node.

enableAutoSoftwareUpdatebooleanenable_auto_software_updateboolenableAutoSoftwareUpdateBooleanEnableAutoSoftwareUpdateboolEnableAutoSoftwareUpdate*bool= false#
Specifies whether automatic service software updates are enabled for the domain.
enableVersionUpgradebooleanenable_version_upgradeboolenableVersionUpgradeBooleanEnableVersionUpgradeboolEnableVersionUpgrade*bool= false#
To upgrade an Amazon OpenSearch Service domain to a new version, rather than replacing the entire domain resource, use the EnableVersionUpgrade update policy.
encryptionAtRestEncryptionAtRestOptionsencryption_at_restEncryptionAtRestOptionsencryptionAtRestEncryptionAtRestOptionsEncryptionAtRestEncryptionAtRestOptionsEncryptionAtRestEncryptionAtRestOptions= No encryption at rest#
Encryption at rest options for the cluster.
enforceHttpsbooleanenforce_httpsboolenforceHttpsBooleanEnforceHttpsboolEnforceHttps*bool= false#
True to require that all traffic to the domain arrive over HTTPS.
fineGrainedAccessControlAdvancedSecurityOptionsfine_grained_access_controlAdvancedSecurityOptionsfineGrainedAccessControlAdvancedSecurityOptionsFineGrainedAccessControlAdvancedSecurityOptionsFineGrainedAccessControlAdvancedSecurityOptions= fine-grained access control is d…#
Specifies options for fine-grained access control.

Requires Elasticsearch version 6.7 or later or OpenSearch version 1.0 or later. Enabling fine-grained access control also requires encryption of data at rest and node-to-node encryption, along with enforced HTTPS.

default

Default: fine-grained access control is disabled

ipAddressTypeIpAddressTypeip_address_typeIpAddressTypeipAddressTypeIpAddressTypeIpAddressTypeIpAddressTypeIpAddressTypeIpAddressType= IpAddressType.IPV4#
Specify either dual stack or IPv4 as your IP address type.

Dual stack allows you to share domain resources across IPv4 and IPv6 address types, and is the recommended option.

If you set your IP address type to dual stack, you can't change your address type later.

loggingLoggingOptionsloggingLoggingOptionsloggingLoggingOptionsLoggingLoggingOptionsLoggingLoggingOptions= No logs are published#
Configuration log publishing configuration options.
nodeToNodeEncryptionbooleannode_to_node_encryptionboolnodeToNodeEncryptionBooleanNodeToNodeEncryptionboolNodeToNodeEncryption*bool= Node to node encryption is not e…#
Specify true to enable node to node encryption.

Requires Elasticsearch version 6.0 or later or OpenSearch version 1.0 or later.

default

Default: Node to node encryption is not enabled.

offPeakWindowEnabledbooleanoff_peak_window_enabledbooloffPeakWindowEnabledBooleanOffPeakWindowEnabledboolOffPeakWindowEnabled*bool= Disabled for domains created bef…#
Options for enabling a domain's off-peak window, during which OpenSearch Service can perform mandatory configuration changes on the domain.
notes · default

Off-peak windows were introduced on February 16, 2023. All domains created before this date have the off-peak window disabled by default. You must manually enable and configure the off-peak window for these domains. All domains created after this date will have the off-peak window enabled by default. You can't disable the off-peak window for a domain after it's enabled.

Default: Disabled for domains created before February 16, 2023. Enabled for domains created after. Enabled if offPeakWindowStart is set.

offPeakWindowStartWindowStartTimeoff_peak_window_startWindowStartTimeoffPeakWindowStartWindowStartTimeOffPeakWindowStartWindowStartTimeOffPeakWindowStartWindowStartTime= 10:00 P.M. local time#
Start time for the off-peak window, in Coordinated Universal Time (UTC).

The window length will always be 10 hours, so you can't specify an end time. For example, if you specify 11:00 P.M. UTC as a start time, the end time will automatically be set to 9:00 A.M.

removalPolicyRemovalPolicyremoval_policyRemovalPolicyremovalPolicyRemovalPolicyRemovalPolicyRemovalPolicyRemovalPolicyRemovalPolicy= RemovalPolicy.RETAIN#
Policy to apply when the domain is removed from the stack.
s3VectorsEngineEnabledbooleans3_vectors_engine_enabledbools3VectorsEngineEnabledBooleanS3VectorsEngineEnabledboolS3VectorsEngineEnabled*bool= undefined - AWS OpenSearch Servi…#
Whether to enable S3 vectors engine.
notes · default

This feature allows you to offload vector data to Amazon S3 while maintaining sub-second vector search capabilities at low cost.

Requirements:

  • OpenSearch version 2.19 or later
  • OpenSearch Optimized instance types (OR*, OM*, OI*) for data nodes
  • Encryption at rest must be enabled

Default: undefined - AWS OpenSearch Service default is false

securityGroupsISecurityGroup[]security_groupstyping.List[ISecurityGroup]securityGroupsList<ISecurityGroup>SecurityGroupsISecurityGroup[]SecurityGroups*[]ISecurityGroup= One new security group is create…#
The list of security groups that are associated with the VPC endpoints for the domain.

Only used if vpc is specified.

default

Default: One new security group is created.

suppressLogsResourcePolicybooleansuppress_logs_resource_policyboolsuppressLogsResourcePolicyBooleanSuppressLogsResourcePolicyboolSuppressLogsResourcePolicy*bool= false#
Specify whether to create a CloudWatch Logs resource policy or not.
notes

When logging is enabled for the domain, a CloudWatch Logs resource policy is created by default. However, CloudWatch Logs supports only 10 resource policies per region. If you enable logging for several domains, it may hit the quota and cause an error. By setting this property to true, creating a resource policy is suppressed, allowing you to avoid this problem.

If you set this option to true, you must create a resource policy before deployment.

tlsSecurityPolicyTLSSecurityPolicytls_security_policyTLSSecurityPolicytlsSecurityPolicyTLSSecurityPolicyTlsSecurityPolicyTLSSecurityPolicyTlsSecurityPolicyTLSSecurityPolicy= TLSSecurityPolicy.TLS_1_2#
The minimum TLS version required for traffic to the domain.
useLatestServiceSoftwareForBlueGreenbooleanuse_latest_service_software_for_blue_greenbooluseLatestServiceSoftwareForBlueGreenBooleanUseLatestServiceSoftwareForBlueGreenboolUseLatestServiceSoftwareForBlueGreen*bool= no value is set and the service …#
Specifies whether the domain should use the latest service software version during a blue/green deployment.

If enabled, the domain will automatically use the latest available service software when a blue/green deployment is triggered.

default

Default: no value is set and the service default is used

useUnsignedBasicAuthbooleanuse_unsigned_basic_authbooluseUnsignedBasicAuthBooleanUseUnsignedBasicAuthboolUseUnsignedBasicAuth*bool= false#
Configures the domain so that unsigned basic auth is enabled.
notes

If no master user is provided a default master user with username admin and a dynamically generated password stored in KMS is created. The password can be retrieved by getting masterUserPassword from the domain instance.

Setting this to true will also add an access policy that allows unsigned access, enable node to node encryption, encryption at rest. If conflicting settings are encountered (like disabling encryption at rest) enabling this setting will cause a failure.

The Elasticsearch/OpenSearch version that your domain will leverage.
vpcIVpcvpcIVpcvpcIVpcVpcIVpcVpcIVpc= Domain is not placed in a VPC.#
Place the domain inside this VPC.
vpcSubnetsSubnetSelection[]vpc_subnetstyping.List[SubnetSelection]vpcSubnetsList<SubnetSelection>VpcSubnetsSubnetSelection[]VpcSubnets*[]SubnetSelection= All private subnets.#
The specific vpc subnets the domain will be placed in.

You must provide one subnet for each Availability Zone that your domain uses. For example, you must specify three subnet IDs for a three Availability Zone domain.

Only used if vpc is specified.

zoneAwarenessZoneAwarenessConfigzone_awarenessZoneAwarenessConfigzoneAwarenessZoneAwarenessConfigZoneAwarenessZoneAwarenessConfigZoneAwarenessZoneAwarenessConfig= no zone awareness (1 AZ)#
The cluster zone awareness configuration for the Amazon OpenSearch Service domain.

Properties ​

appLogGroupILogGroupapp_log_groupILogGroupappLogGroupILogGroupAppLogGroupILogGroupAppLogGroupILogGroup#
Log group that application logs are logged to.
auditLogGroupILogGroupaudit_log_groupILogGroupauditLogGroupILogGroupAuditLogGroupILogGroupAuditLogGroupILogGroup#
Log group that audit logs are logged to.
connectionsConnectionsconnectionsConnectionsconnectionsConnectionsConnectionsConnectionsConnectionsConnectionsrequired#
Manages network connections to the domain.

This will throw an error in case the domain is not placed inside a VPC.

domainArnstringdomain_arnstrdomainArnStringDomainArnstringDomainArn*stringrequired#
Arn of the Amazon OpenSearch Service domain.
domainEndpointstringdomain_endpointstrdomainEndpointStringDomainEndpointstringDomainEndpoint*stringrequired#
Endpoint of the Amazon OpenSearch Service domain.
domainIdstringdomain_idstrdomainIdStringDomainIdstringDomainId*stringrequired#
Identifier of the Amazon OpenSearch Service domain.
domainNamestringdomain_namestrdomainNameStringDomainNamestringDomainName*stringrequired#
Domain name of the Amazon OpenSearch Service domain.
domainRefDomainReferencedomain_refDomainReferencedomainRefDomainReferenceDomainRefDomainReferenceDomainRefDomainReferencerequired#
A reference to a Domain resource.
The environment this resource belongs to.
notes

For resources that are created and managed in a Stack (those created by creating new class instances like new Role(), new Bucket(), etc.), this is always the same as the environment of the stack they belong to.

For referenced resources (those obtained from referencing methods like Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be different than the stack they were imported into.

Collection of grant methods for a Domain.
masterUserPasswordSecretValuemaster_user_passwordSecretValuemasterUserPasswordSecretValueMasterUserPasswordSecretValueMasterUserPasswordSecretValue#
Master user password if fine grained access control is configured.
nodeNodenodeNodenodeNodeNodeNodeNodeNoderequired#
The tree node.
PROPERTY_INJECTION_IDstringproperty_injection_idstrPROPERTY_INJECTION_IDStringPROPERTY_INJECTION_IDstringPROPERTY_INJECTION_ID*stringrequiredstatic#
Uniquely identifies this class.
slowIndexLogGroupILogGroupslow_index_log_groupILogGroupslowIndexLogGroupILogGroupSlowIndexLogGroupILogGroupSlowIndexLogGroupILogGroup#
Log group that slow indices are logged to.
slowSearchLogGroupILogGroupslow_search_log_groupILogGroupslowSearchLogGroupILogGroupSlowSearchLogGroupILogGroupSlowSearchLogGroupILogGroup#
Log group that slow searches are logged to.
stackStackstackStackstackStackStackStackStackStackrequired#
The stack in which this resource is defined.

Methods ​

addAccessPolicies(...accessPolicyStatements: PolicyStatement[]): voiddef add_access_policies(self, access_policy_statements: PolicyStatement) -> Nonepublic void addAccessPolicies(PolicyStatement accessPolicyStatements)public void AddAccessPolicies(PolicyStatement accessPolicyStatements)func AddAccessPolicies(AccessPolicyStatements PolicyStatement)#
Add policy statements to the domain access policy.
applyCrossStackReferenceStrength(strength: ReferenceStrength): voiddef apply_cross_stack_reference_strength(self, strength: ReferenceStrength) -> Nonepublic void applyCrossStackReferenceStrength(ReferenceStrength strength)public void ApplyCrossStackReferenceStrength(ReferenceStrength strength)func ApplyCrossStackReferenceStrength(Strength ReferenceStrength)#
Override the cross-stack reference strength for this resource.
notes · 1 parameter

When set, any cross-stack reference to this resource will use the specified mechanism instead of the global default determined by the @aws-cdk/core:defaultCrossStackReferences context key. This is useful for selectively weakening specific references to avoid the "deadly embrace" problem without changing the app-wide default.

Parameters

  • strengthstrengthstrengthstrengthStrength — - The reference strength to use for this resource.
applyRemovalPolicy(policy: RemovalPolicy): voiddef apply_removal_policy(self, policy: RemovalPolicy) -> Nonepublic void applyRemovalPolicy(RemovalPolicy policy)public void ApplyRemovalPolicy(RemovalPolicy policy)func ApplyRemovalPolicy(Policy RemovalPolicy)#
Apply the given removal policy to this resource.
notes

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

fromDomainAttributes(scope: Construct, id: string, attrs: DomainAttributes): IDomain@staticmethod def from_domain_attributes(scope: Construct, id: str, attrs: DomainAttributes) -> IDomainpublic static IDomain fromDomainAttributes(Construct scope, String id, DomainAttributes attrs)public static IDomain FromDomainAttributes(Construct scope, string id, DomainAttributes attrs)func FromDomainAttributes(Scope Construct, Id *string, Attrs DomainAttributes) IDomainstatic#
Creates a domain construct that represents an external domain.
3 parameters

Parameters

  • scopescopescopescopeScope — The parent creating construct (usually this).
  • ididididId — The construct's name.
  • attrsattrsattrsattrsAttrs — A DomainAttributes object.
fromDomainEndpoint(scope: Construct, id: string, domainEndpoint: string): IDomain@staticmethod def from_domain_endpoint(scope: Construct, id: str, domain_endpoint: str) -> IDomainpublic static IDomain fromDomainEndpoint(Construct scope, String id, String domainEndpoint)public static IDomain FromDomainEndpoint(Construct scope, string id, string domainEndpoint)func FromDomainEndpoint(Scope Construct, Id *string, DomainEndpoint *string) IDomainstatic#
Creates a domain construct that represents an external domain via domain endpoint.
3 parameters

Parameters

  • scopescopescopescopeScope — The parent creating construct (usually this).
  • ididididId — The construct's name.
  • domainEndpointdomain_endpointdomainEndpointdomainEndpointDomainEndpoint — The domain's endpoint.
grantIndexRead(index: string, identity: IGrantable): Grantdef grant_index_read(self, index: str, identity: IGrantable) -> Grantpublic Grant grantIndexRead(String index, IGrantable identity)public Grant GrantIndexRead(string index, IGrantable identity)func GrantIndexRead(Index *string, Identity IGrantable) Grant#
Grant read permissions for an index in this domain to an IAM principal (Role/Group/User).

[disable-awslint:no-grants]

2 parameters

Parameters

  • indexindexindexindexIndex — The index to grant permissions for.
  • identityidentityidentityidentityIdentity — The principal.
grantIndexReadWrite(index: string, identity: IGrantable): Grantdef grant_index_read_write(self, index: str, identity: IGrantable) -> Grantpublic Grant grantIndexReadWrite(String index, IGrantable identity)public Grant GrantIndexReadWrite(string index, IGrantable identity)func GrantIndexReadWrite(Index *string, Identity IGrantable) Grant#
Grant read/write permissions for an index in this domain to an IAM principal (Role/Group/User).

[disable-awslint:no-grants]

2 parameters

Parameters

  • indexindexindexindexIndex — The index to grant permissions for.
  • identityidentityidentityidentityIdentity — The principal.
grantIndexWrite(index: string, identity: IGrantable): Grantdef grant_index_write(self, index: str, identity: IGrantable) -> Grantpublic Grant grantIndexWrite(String index, IGrantable identity)public Grant GrantIndexWrite(string index, IGrantable identity)func GrantIndexWrite(Index *string, Identity IGrantable) Grant#
Grant write permissions for an index in this domain to an IAM principal (Role/Group/User).

[disable-awslint:no-grants]

2 parameters

Parameters

  • indexindexindexindexIndex — The index to grant permissions for.
  • identityidentityidentityidentityIdentity — The principal.
grantPathRead(path: string, identity: IGrantable): Grantdef grant_path_read(self, path: str, identity: IGrantable) -> Grantpublic Grant grantPathRead(String path, IGrantable identity)public Grant GrantPathRead(string path, IGrantable identity)func GrantPathRead(Path *string, Identity IGrantable) Grant#
Grant read permissions for a specific path in this domain to an IAM principal (Role/Group/User).

[disable-awslint:no-grants]

2 parameters

Parameters

  • pathpathpathpathPath — The path to grant permissions for.
  • identityidentityidentityidentityIdentity — The principal.
grantPathReadWrite(path: string, identity: IGrantable): Grantdef grant_path_read_write(self, path: str, identity: IGrantable) -> Grantpublic Grant grantPathReadWrite(String path, IGrantable identity)public Grant GrantPathReadWrite(string path, IGrantable identity)func GrantPathReadWrite(Path *string, Identity IGrantable) Grant#
Grant read/write permissions for a specific path in this domain to an IAM principal (Role/Group/User).

[disable-awslint:no-grants]

2 parameters

Parameters

  • pathpathpathpathPath — The path to grant permissions for.
  • identityidentityidentityidentityIdentity — The principal.
grantPathWrite(path: string, identity: IGrantable): Grantdef grant_path_write(self, path: str, identity: IGrantable) -> Grantpublic Grant grantPathWrite(String path, IGrantable identity)public Grant GrantPathWrite(string path, IGrantable identity)func GrantPathWrite(Path *string, Identity IGrantable) Grant#
Grant write permissions for a specific path in this domain to an IAM principal (Role/Group/User).

[disable-awslint:no-grants]

2 parameters

Parameters

  • pathpathpathpathPath — The path to grant permissions for.
  • identityidentityidentityidentityIdentity — The principal.
grantRead(identity: IGrantable): Grantdef grant_read(self, identity: IGrantable) -> Grantpublic Grant grantRead(IGrantable identity)public Grant GrantRead(IGrantable identity)func GrantRead(Identity IGrantable) Grant#
Grant read permissions for this domain and its contents to an IAM principal (Role/Group/User).

[disable-awslint:no-grants]

1 parameter

Parameters

  • identityidentityidentityidentityIdentity — The principal.
grantReadWrite(identity: IGrantable): Grantdef grant_read_write(self, identity: IGrantable) -> Grantpublic Grant grantReadWrite(IGrantable identity)public Grant GrantReadWrite(IGrantable identity)func GrantReadWrite(Identity IGrantable) Grant#
Grant read/write permissions for this domain and its contents to an IAM principal (Role/Group/User).

[disable-awslint:no-grants]

1 parameter

Parameters

  • identityidentityidentityidentityIdentity — The principal.
grantWrite(identity: IGrantable): Grantdef grant_write(self, identity: IGrantable) -> Grantpublic Grant grantWrite(IGrantable identity)public Grant GrantWrite(IGrantable identity)func GrantWrite(Identity IGrantable) Grant#
Grant write permissions for this domain and its contents to an IAM principal (Role/Group/User).

[disable-awslint:no-grants]

1 parameter

Parameters

  • identityidentityidentityidentityIdentity — The principal.
isConstruct(x: any): boolean@staticmethod def is_construct(x: Any) -> boolpublic static Boolean isConstruct(Object x)public static bool IsConstruct(object x)func IsConstruct(X interface{}) *boolstatic#
Checks if `x` is a construct.
notes · 1 parameter · returns

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

Parameters

  • xxxxX — Any object.

Returns: true if x is an object created from a class which extends Construct.

isOwnedResource(construct: IConstruct): boolean@staticmethod def is_owned_resource(construct: IConstruct) -> boolpublic static Boolean isOwnedResource(IConstruct construct)public static bool IsOwnedResource(IConstruct construct)func IsOwnedResource(Construct IConstruct) *boolstatic#
Returns true if the construct was created by CDK, and false otherwise.
isResource(construct: IConstruct): boolean@staticmethod def is_resource(construct: IConstruct) -> boolpublic static Boolean isResource(IConstruct construct)public static bool IsResource(IConstruct construct)func IsResource(Construct IConstruct) *boolstatic#
Check whether the given construct is a Resource.
metric(metricName: string, props?: MetricOptions): Metricdef metric(self, metric_name: str, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metric(String metricName, MetricOptions props)public Metric Metric(string metricName, MetricOptions? props = null)func Metric(MetricName *string, Props MetricOptions) Metric#
Return the given named metric for this domain.
metricAutomatedSnapshotFailure(props?: MetricOptions): Metricdef metric_automated_snapshot_failure(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricAutomatedSnapshotFailure(MetricOptions props)public Metric MetricAutomatedSnapshotFailure(MetricOptions? props = null)func MetricAutomatedSnapshotFailure(Props MetricOptions) Metric#
Metric for automated snapshot failures.
metricClusterIndexWritesBlocked(props?: MetricOptions): Metricdef metric_cluster_index_writes_blocked(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricClusterIndexWritesBlocked(MetricOptions props)public Metric MetricClusterIndexWritesBlocked(MetricOptions? props = null)func MetricClusterIndexWritesBlocked(Props MetricOptions) Metric#
Metric for the cluster blocking index writes.
metricClusterStatusRed(props?: MetricOptions): Metricdef metric_cluster_status_red(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricClusterStatusRed(MetricOptions props)public Metric MetricClusterStatusRed(MetricOptions? props = null)func MetricClusterStatusRed(Props MetricOptions) Metric#
Metric for the time the cluster status is red.
metricClusterStatusYellow(props?: MetricOptions): Metricdef metric_cluster_status_yellow(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricClusterStatusYellow(MetricOptions props)public Metric MetricClusterStatusYellow(MetricOptions? props = null)func MetricClusterStatusYellow(Props MetricOptions) Metric#
Metric for the time the cluster status is yellow.
metricCPUUtilization(props?: MetricOptions): Metricdef metric_cpu_utilization(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricCPUUtilization(MetricOptions props)public Metric MetricCPUUtilization(MetricOptions? props = null)func MetricCPUUtilization(Props MetricOptions) Metric#
Metric for CPU utilization.
metricFreeStorageSpace(props?: MetricOptions): Metricdef metric_free_storage_space(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricFreeStorageSpace(MetricOptions props)public Metric MetricFreeStorageSpace(MetricOptions? props = null)func MetricFreeStorageSpace(Props MetricOptions) Metric#
Metric for the storage space of nodes in the cluster.
metricIndexingLatency(props?: MetricOptions): Metricdef metric_indexing_latency(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricIndexingLatency(MetricOptions props)public Metric MetricIndexingLatency(MetricOptions? props = null)func MetricIndexingLatency(Props MetricOptions) Metric#
Metric for indexing latency.
metricJVMMemoryPressure(props?: MetricOptions): Metricdef metric_jvm_memory_pressure(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricJVMMemoryPressure(MetricOptions props)public Metric MetricJVMMemoryPressure(MetricOptions? props = null)func MetricJVMMemoryPressure(Props MetricOptions) Metric#
Metric for JVM memory pressure.
metricKMSKeyError(props?: MetricOptions): Metricdef metric_kms_key_error(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricKMSKeyError(MetricOptions props)public Metric MetricKMSKeyError(MetricOptions? props = null)func MetricKMSKeyError(Props MetricOptions) Metric#
Metric for KMS key errors.
metricKMSKeyInaccessible(props?: MetricOptions): Metricdef metric_kms_key_inaccessible(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricKMSKeyInaccessible(MetricOptions props)public Metric MetricKMSKeyInaccessible(MetricOptions? props = null)func MetricKMSKeyInaccessible(Props MetricOptions) Metric#
Metric for KMS key being inaccessible.
metricMasterCPUUtilization(props?: MetricOptions): Metricdef metric_master_cpu_utilization(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricMasterCPUUtilization(MetricOptions props)public Metric MetricMasterCPUUtilization(MetricOptions? props = null)func MetricMasterCPUUtilization(Props MetricOptions) Metric#
Metric for master CPU utilization.
metricMasterJVMMemoryPressure(props?: MetricOptions): Metricdef metric_master_jvm_memory_pressure(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricMasterJVMMemoryPressure(MetricOptions props)public Metric MetricMasterJVMMemoryPressure(MetricOptions? props = null)func MetricMasterJVMMemoryPressure(Props MetricOptions) Metric#
Metric for master JVM memory pressure.
metricNodes(props?: MetricOptions): Metricdef metric_nodes(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricNodes(MetricOptions props)public Metric MetricNodes(MetricOptions? props = null)func MetricNodes(Props MetricOptions) Metric#
Metric for the number of nodes.
metricSearchableDocuments(props?: MetricOptions): Metricdef metric_searchable_documents(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricSearchableDocuments(MetricOptions props)public Metric MetricSearchableDocuments(MetricOptions? props = null)func MetricSearchableDocuments(Props MetricOptions) Metric#
Metric for number of searchable documents.
metricSearchLatency(props?: MetricOptions): Metricdef metric_search_latency(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricSearchLatency(MetricOptions props)public Metric MetricSearchLatency(MetricOptions? props = null)func MetricSearchLatency(Props MetricOptions) Metric#
Metric for search latency.
toString(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string#
Returns a string representation of this construct.
with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) IConstruct#
Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.