All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.awsnative.opensearchservice.kotlin.Domain.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 1.24.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.awsnative.opensearchservice.kotlin

import com.pulumi.awsnative.kotlin.outputs.Tag
import com.pulumi.awsnative.opensearchservice.kotlin.outputs.DomainAdvancedSecurityOptionsInput
import com.pulumi.awsnative.opensearchservice.kotlin.outputs.DomainClusterConfig
import com.pulumi.awsnative.opensearchservice.kotlin.outputs.DomainCognitoOptions
import com.pulumi.awsnative.opensearchservice.kotlin.outputs.DomainEbsOptions
import com.pulumi.awsnative.opensearchservice.kotlin.outputs.DomainEncryptionAtRestOptions
import com.pulumi.awsnative.opensearchservice.kotlin.outputs.DomainEndpointOptions
import com.pulumi.awsnative.opensearchservice.kotlin.outputs.DomainLogPublishingOption
import com.pulumi.awsnative.opensearchservice.kotlin.outputs.DomainNodeToNodeEncryptionOptions
import com.pulumi.awsnative.opensearchservice.kotlin.outputs.DomainOffPeakWindowOptions
import com.pulumi.awsnative.opensearchservice.kotlin.outputs.DomainServiceSoftwareOptions
import com.pulumi.awsnative.opensearchservice.kotlin.outputs.DomainSnapshotOptions
import com.pulumi.awsnative.opensearchservice.kotlin.outputs.DomainSoftwareUpdateOptions
import com.pulumi.awsnative.opensearchservice.kotlin.outputs.DomainVpcOptions
import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Any
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin
import com.pulumi.awsnative.opensearchservice.kotlin.outputs.DomainAdvancedSecurityOptionsInput.Companion.toKotlin as domainAdvancedSecurityOptionsInputToKotlin
import com.pulumi.awsnative.opensearchservice.kotlin.outputs.DomainClusterConfig.Companion.toKotlin as domainClusterConfigToKotlin
import com.pulumi.awsnative.opensearchservice.kotlin.outputs.DomainCognitoOptions.Companion.toKotlin as domainCognitoOptionsToKotlin
import com.pulumi.awsnative.opensearchservice.kotlin.outputs.DomainEbsOptions.Companion.toKotlin as domainEbsOptionsToKotlin
import com.pulumi.awsnative.opensearchservice.kotlin.outputs.DomainEncryptionAtRestOptions.Companion.toKotlin as domainEncryptionAtRestOptionsToKotlin
import com.pulumi.awsnative.opensearchservice.kotlin.outputs.DomainEndpointOptions.Companion.toKotlin as domainEndpointOptionsToKotlin
import com.pulumi.awsnative.opensearchservice.kotlin.outputs.DomainLogPublishingOption.Companion.toKotlin as domainLogPublishingOptionToKotlin
import com.pulumi.awsnative.opensearchservice.kotlin.outputs.DomainNodeToNodeEncryptionOptions.Companion.toKotlin as domainNodeToNodeEncryptionOptionsToKotlin
import com.pulumi.awsnative.opensearchservice.kotlin.outputs.DomainOffPeakWindowOptions.Companion.toKotlin as domainOffPeakWindowOptionsToKotlin
import com.pulumi.awsnative.opensearchservice.kotlin.outputs.DomainServiceSoftwareOptions.Companion.toKotlin as domainServiceSoftwareOptionsToKotlin
import com.pulumi.awsnative.opensearchservice.kotlin.outputs.DomainSnapshotOptions.Companion.toKotlin as domainSnapshotOptionsToKotlin
import com.pulumi.awsnative.opensearchservice.kotlin.outputs.DomainSoftwareUpdateOptions.Companion.toKotlin as domainSoftwareUpdateOptionsToKotlin
import com.pulumi.awsnative.opensearchservice.kotlin.outputs.DomainVpcOptions.Companion.toKotlin as domainVpcOptionsToKotlin

/**
 * Builder for [Domain].
 */
@PulumiTagMarker
public class DomainResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: DomainArgs = DomainArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend DomainArgsBuilder.() -> Unit) {
        val builder = DomainArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): Domain {
        val builtJavaResource = com.pulumi.awsnative.opensearchservice.Domain(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return Domain(builtJavaResource)
    }
}

/**
 * An example resource schema demonstrating some basic constructs and validation rules.
 */
public class Domain internal constructor(
    override val javaResource: com.pulumi.awsnative.opensearchservice.Domain,
) : KotlinCustomResource(javaResource, DomainMapper) {
    /**
     * An AWS Identity and Access Management ( IAM ) policy document that specifies who can access the OpenSearch Service domain and their permissions. For more information, see [Configuring access policies](https://docs.aws.amazon.com/opensearch-service/latest/developerguide/ac.html#ac-creating) in the *Amazon OpenSearch Service Developer Guide* .
     * Search the [CloudFormation User Guide](https://docs.aws.amazon.com/cloudformation/) for `AWS::OpenSearchService::Domain` for more information about the expected schema for this property.
     */
    public val accessPolicies: Output?
        get() = javaResource.accessPolicies().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Additional options to specify for the OpenSearch Service domain. For more information, see [AdvancedOptions](https://docs.aws.amazon.com/opensearch-service/latest/APIReference/API_CreateDomain.html#API_CreateDomain_RequestBody) in the OpenSearch Service API reference.
     */
    public val advancedOptions: Output>?
        get() = javaResource.advancedOptions().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 -> args0.key.to(args0.value) }).toMap()
            }).orElse(null)
        })

    /**
     * Specifies options for fine-grained access control and SAML authentication.
     * If you specify advanced security options, you must also enable node-to-node encryption ( [NodeToNodeEncryptionOptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opensearchservice-domain-nodetonodeencryptionoptions.html) ) and encryption at rest ( [EncryptionAtRestOptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opensearchservice-domain-encryptionatrestoptions.html) ). You must also enable `EnforceHTTPS` within [DomainEndpointOptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opensearchservice-domain-domainendpointoptions.html) , which requires HTTPS for all traffic to the domain.
     */
    public val advancedSecurityOptions: Output?
        get() = javaResource.advancedSecurityOptions().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> domainAdvancedSecurityOptionsInputToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * The Amazon Resource Name (ARN) of the CloudFormation stack.
     */
    public val arn: Output
        get() = javaResource.arn().applyValue({ args0 -> args0 })

    /**
     * The resource ID. For example, `123456789012/my-domain` .
     */
    public val awsId: Output
        get() = javaResource.awsId().applyValue({ args0 -> args0 })

    /**
     * Container for the cluster configuration of a domain.
     */
    public val clusterConfig: Output?
        get() = javaResource.clusterConfig().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> domainClusterConfigToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * Configures OpenSearch Service to use Amazon Cognito authentication for OpenSearch Dashboards.
     */
    public val cognitoOptions: Output?
        get() = javaResource.cognitoOptions().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> domainCognitoOptionsToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * The Amazon Resource Name (ARN) of the domain. See [Identifiers for IAM Entities](https://docs.aws.amazon.com/IAM/latest/UserGuide/index.html) in *Using AWS Identity and Access Management* for more information.
     */
    public val domainArn: Output
        get() = javaResource.domainArn().applyValue({ args0 -> args0 })

    /**
     * The domain-specific endpoint used for requests to the OpenSearch APIs, such as `search-mystack-1ab2cdefghij-ab1c2deckoyb3hofw7wpqa3cm.us-west-1.es.amazonaws.com` .
     */
    public val domainEndpoint: Output
        get() = javaResource.domainEndpoint().applyValue({ args0 -> args0 })

    /**
     * Specifies additional options for the domain endpoint, such as whether to require HTTPS for all traffic or whether to use a custom endpoint rather than the default endpoint.
     */
    public val domainEndpointOptions: Output?
        get() = javaResource.domainEndpointOptions().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> domainEndpointOptionsToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * If `IPAddressType` to set to `dualstack` , a version 2 domain endpoint is provisioned. This endpoint functions like a normal endpoint, except that it works with both IPv4 and IPv6 IP addresses. Normal endpoints work only with IPv4 IP addresses.
     */
    public val domainEndpointV2: Output
        get() = javaResource.domainEndpointV2().applyValue({ args0 -> args0 })

    public val domainEndpoints: Output>
        get() = javaResource.domainEndpoints().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.key.to(args0.value)
            }).toMap()
        })

    /**
     * A name for the OpenSearch Service domain. The name must have a minimum length of 3 and a maximum length of 28. If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the domain name. For more information, see [Name Type](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-name.html) .
     * Required when creating a new domain.
     * > If you specify a name, you can't perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name.
     */
    public val domainName: Output?
        get() = javaResource.domainName().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The configurations of Amazon Elastic Block Store (Amazon EBS) volumes that are attached to data nodes in the OpenSearch Service domain. For more information, see [EBS volume size limits](https://docs.aws.amazon.com/opensearch-service/latest/developerguide/limits.html#ebsresource) in the *Amazon OpenSearch Service Developer Guide* .
     */
    public val ebsOptions: Output?
        get() = javaResource.ebsOptions().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    domainEbsOptionsToKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * Whether the domain should encrypt data at rest, and if so, the AWS KMS key to use. See [Encryption of data at rest for Amazon OpenSearch Service](https://docs.aws.amazon.com/opensearch-service/latest/developerguide/encryption-at-rest.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.
     */
    public val encryptionAtRestOptions: Output?
        get() = javaResource.encryptionAtRestOptions().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> domainEncryptionAtRestOptionsToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * The version of OpenSearch to use. The value must be in the format `OpenSearch_X.Y` or `Elasticsearch_X.Y` . If not specified, the latest version of OpenSearch is used. For information about the versions that OpenSearch Service supports, see [Supported versions of OpenSearch and Elasticsearch](https://docs.aws.amazon.com/opensearch-service/latest/developerguide/what-is.html#choosing-version) in the *Amazon OpenSearch Service Developer Guide* .
     * If you set the [EnableVersionUpgrade](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatepolicy.html#cfn-attributes-updatepolicy-upgradeopensearchdomain) update policy to `true` , you can update `EngineVersion` without interruption. When `EnableVersionUpgrade` is set to `false` , or is not specified, updating `EngineVersion` results in [replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement) .
     */
    public val engineVersion: Output?
        get() = javaResource.engineVersion().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Choose 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.
     */
    public val ipAddressType: Output?
        get() = javaResource.ipAddressType().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * An object with one or more of the following keys: `SEARCH_SLOW_LOGS` , `ES_APPLICATION_LOGS` , `INDEX_SLOW_LOGS` , `AUDIT_LOGS` , depending on the types of logs you want to publish. Each key needs a valid `LogPublishingOption` value. For the full syntax, see the [examples](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opensearchservice-domain.html#aws-resource-opensearchservice-domain--examples) .
     */
    public val logPublishingOptions: Output>?
        get() = javaResource.logPublishingOptions().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(
                        args0.value.let({ args0 ->
                            domainLogPublishingOptionToKotlin(args0)
                        }),
                    )
                }).toMap()
            }).orElse(null)
        })

    /**
     * Specifies whether node-to-node encryption is enabled. See [Node-to-node encryption for Amazon OpenSearch Service](https://docs.aws.amazon.com/opensearch-service/latest/developerguide/ntn.html) .
     */
    public val nodeToNodeEncryptionOptions: Output?
        get() = javaResource.nodeToNodeEncryptionOptions().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> domainNodeToNodeEncryptionOptionsToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * Options for a domain's off-peak window, during which OpenSearch Service can perform mandatory configuration changes on the domain.
     */
    public val offPeakWindowOptions: Output?
        get() = javaResource.offPeakWindowOptions().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> domainOffPeakWindowOptionsToKotlin(args0) })
            }).orElse(null)
        })

    public val serviceSoftwareOptions: Output
        get() = javaResource.serviceSoftwareOptions().applyValue({ args0 ->
            args0.let({ args0 ->
                domainServiceSoftwareOptionsToKotlin(args0)
            })
        })

    /**
     * *DEPRECATED* . The automated snapshot configuration for the OpenSearch Service domain indexes.
     */
    public val snapshotOptions: Output?
        get() = javaResource.snapshotOptions().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> domainSnapshotOptionsToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * Service software update options for the domain.
     */
    public val softwareUpdateOptions: Output?
        get() = javaResource.softwareUpdateOptions().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> domainSoftwareUpdateOptionsToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * An arbitrary set of tags (key-value pairs) for this Domain.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> tagToKotlin(args0) })
                })
            }).orElse(null)
        })

    /**
     * The virtual private cloud (VPC) configuration for the OpenSearch Service domain. For more information, see [Launching your Amazon OpenSearch Service domains within a VPC](https://docs.aws.amazon.com/opensearch-service/latest/developerguide/vpc.html) in the *Amazon OpenSearch Service Developer Guide* .
     * If you remove this entity altogether, along with its associated properties, it causes a replacement. You might encounter this scenario if you're updating your security configuration from a VPC to a public endpoint.
     */
    public val vpcOptions: Output?
        get() = javaResource.vpcOptions().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    domainVpcOptionsToKotlin(args0)
                })
            }).orElse(null)
        })
}

public object DomainMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.opensearchservice.Domain::class == javaResource::class

    override fun map(javaResource: Resource): Domain = Domain(
        javaResource as
            com.pulumi.awsnative.opensearchservice.Domain,
    )
}

/**
 * @see [Domain].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [Domain].
 */
public suspend fun domain(name: String, block: suspend DomainResourceBuilder.() -> Unit): Domain {
    val builder = DomainResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [Domain].
 * @param name The _unique_ name of the resulting resource.
 */
public fun domain(name: String): Domain {
    val builder = DomainResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy