com.pulumi.awsnative.cassandra.kotlin.Keyspace.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.cassandra.kotlin
import com.pulumi.awsnative.cassandra.kotlin.outputs.KeyspaceReplicationSpecification
import com.pulumi.awsnative.kotlin.outputs.Tag
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.cassandra.kotlin.outputs.KeyspaceReplicationSpecification.Companion.toKotlin as keyspaceReplicationSpecificationToKotlin
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin
/**
* Builder for [Keyspace].
*/
@PulumiTagMarker
public class KeyspaceResourceBuilder internal constructor() {
public var name: String? = null
public var args: KeyspaceArgs = KeyspaceArgs()
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 KeyspaceArgsBuilder.() -> Unit) {
val builder = KeyspaceArgsBuilder()
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(): Keyspace {
val builtJavaResource = com.pulumi.awsnative.cassandra.Keyspace(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Keyspace(builtJavaResource)
}
}
/**
* Resource schema for AWS::Cassandra::Keyspace
* ## Example Usage
* ### Example
* No Java example available.
* ### Example
* No Java example available.
* ### Example
* No Java example available.
*/
public class Keyspace internal constructor(
override val javaResource: com.pulumi.awsnative.cassandra.Keyspace,
) : KotlinCustomResource(javaResource, KeyspaceMapper) {
/**
* Name for Cassandra keyspace
*/
public val keyspaceName: Output?
get() = javaResource.keyspaceName().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Specifies the `ReplicationStrategy` of a keyspace. The options are:
* - `SINGLE_REGION` for a single Region keyspace (optional) or
* - `MULTI_REGION` for a multi-Region keyspace
* If no `ReplicationStrategy` is provided, the default is `SINGLE_REGION` . If you choose `MULTI_REGION` , you must also provide a `RegionList` with the AWS Regions that the keyspace is replicated in.
*/
public val replicationSpecification: Output?
get() = javaResource.replicationSpecification().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> keyspaceReplicationSpecificationToKotlin(args0) })
}).orElse(null)
})
/**
* An array of key-value pairs to apply to this resource.
* For more information, see [Tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html) .
*/
public val tags: Output>?
get() = javaResource.tags().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> tagToKotlin(args0) })
})
}).orElse(null)
})
}
public object KeyspaceMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.cassandra.Keyspace::class == javaResource::class
override fun map(javaResource: Resource): Keyspace = Keyspace(
javaResource as
com.pulumi.awsnative.cassandra.Keyspace,
)
}
/**
* @see [Keyspace].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [Keyspace].
*/
public suspend fun keyspace(name: String, block: suspend KeyspaceResourceBuilder.() -> Unit): Keyspace {
val builder = KeyspaceResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [Keyspace].
* @param name The _unique_ name of the resulting resource.
*/
public fun keyspace(name: String): Keyspace {
val builder = KeyspaceResourceBuilder()
builder.name(name)
return builder.build()
}