com.pulumi.awsnative.opensearchserverless.kotlin.Collection.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-aws-native-kotlin Show documentation
Show all versions of pulumi-aws-native-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.awsnative.opensearchserverless.kotlin
import com.pulumi.awsnative.kotlin.outputs.CreateOnlyTag
import com.pulumi.awsnative.opensearchserverless.kotlin.enums.CollectionStandbyReplicas
import com.pulumi.awsnative.opensearchserverless.kotlin.enums.CollectionType
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.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import com.pulumi.awsnative.kotlin.outputs.CreateOnlyTag.Companion.toKotlin as createOnlyTagToKotlin
import com.pulumi.awsnative.opensearchserverless.kotlin.enums.CollectionStandbyReplicas.Companion.toKotlin as collectionStandbyReplicasToKotlin
import com.pulumi.awsnative.opensearchserverless.kotlin.enums.CollectionType.Companion.toKotlin as collectionTypeToKotlin
/**
* Builder for [Collection].
*/
@PulumiTagMarker
public class CollectionResourceBuilder internal constructor() {
public var name: String? = null
public var args: CollectionArgs = CollectionArgs()
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 CollectionArgsBuilder.() -> Unit) {
val builder = CollectionArgsBuilder()
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(): Collection {
val builtJavaResource =
com.pulumi.awsnative.opensearchserverless.Collection(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Collection(builtJavaResource)
}
}
/**
* Amazon OpenSearchServerless collection resource
* ## Example Usage
* ### Example
* No Java example available.
* ### Example
* No Java example available.
*/
public class Collection internal constructor(
override val javaResource: com.pulumi.awsnative.opensearchserverless.Collection,
) : KotlinCustomResource(javaResource, CollectionMapper) {
/**
* The Amazon Resource Name (ARN) of the collection.
*/
public val arn: Output
get() = javaResource.arn().applyValue({ args0 -> args0 })
/**
* The identifier of the collection
*/
public val awsId: Output
get() = javaResource.awsId().applyValue({ args0 -> args0 })
/**
* The endpoint for the collection.
*/
public val collectionEndpoint: Output
get() = javaResource.collectionEndpoint().applyValue({ args0 -> args0 })
/**
* The OpenSearch Dashboards endpoint for the collection.
*/
public val dashboardEndpoint: Output
get() = javaResource.dashboardEndpoint().applyValue({ args0 -> args0 })
/**
* The description of the collection
*/
public val description: Output?
get() = javaResource.description().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The name of the collection.
* The name must meet the following criteria:
* Unique to your account and AWS Region
* Starts with a lowercase letter
* Contains only lowercase letters a-z, the numbers 0-9 and the hyphen (-)
* Contains between 3 and 32 characters
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* Indicates whether to use standby replicas for the collection. You can't update this property after the collection is already created. If you attempt to modify this property, the collection continues to use the original value.
*/
public val standbyReplicas: Output?
get() = javaResource.standbyReplicas().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> collectionStandbyReplicasToKotlin(args0) })
}).orElse(null)
})
/**
* List of tags to be added to the resource
*/
public val tags: Output>?
get() = javaResource.tags().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> createOnlyTagToKotlin(args0) })
})
}).orElse(null)
})
/**
* The type of collection. Possible values are `SEARCH` , `TIMESERIES` , and `VECTORSEARCH` . For more information, see [Choosing a collection type](https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-overview.html#serverless-usecase) .
*/
public val type: Output?
get() = javaResource.type().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
collectionTypeToKotlin(args0)
})
}).orElse(null)
})
}
public object CollectionMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.opensearchserverless.Collection::class == javaResource::class
override fun map(javaResource: Resource): Collection = Collection(
javaResource as
com.pulumi.awsnative.opensearchserverless.Collection,
)
}
/**
* @see [Collection].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [Collection].
*/
public suspend fun collection(name: String, block: suspend CollectionResourceBuilder.() -> Unit): Collection {
val builder = CollectionResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [Collection].
* @param name The _unique_ name of the resulting resource.
*/
public fun collection(name: String): Collection {
val builder = CollectionResourceBuilder()
builder.name(name)
return builder.build()
}