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

com.pulumi.awsnative.cassandra.kotlin.Table.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.awsnative.cassandra.kotlin

import com.pulumi.awsnative.cassandra.kotlin.outputs.TableAutoScalingSpecification
import com.pulumi.awsnative.cassandra.kotlin.outputs.TableBillingMode
import com.pulumi.awsnative.cassandra.kotlin.outputs.TableClusteringKeyColumn
import com.pulumi.awsnative.cassandra.kotlin.outputs.TableColumn
import com.pulumi.awsnative.cassandra.kotlin.outputs.TableEncryptionSpecification
import com.pulumi.awsnative.cassandra.kotlin.outputs.TableReplicaSpecification
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.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import com.pulumi.awsnative.cassandra.kotlin.outputs.TableAutoScalingSpecification.Companion.toKotlin as tableAutoScalingSpecificationToKotlin
import com.pulumi.awsnative.cassandra.kotlin.outputs.TableBillingMode.Companion.toKotlin as tableBillingModeToKotlin
import com.pulumi.awsnative.cassandra.kotlin.outputs.TableClusteringKeyColumn.Companion.toKotlin as tableClusteringKeyColumnToKotlin
import com.pulumi.awsnative.cassandra.kotlin.outputs.TableColumn.Companion.toKotlin as tableColumnToKotlin
import com.pulumi.awsnative.cassandra.kotlin.outputs.TableEncryptionSpecification.Companion.toKotlin as tableEncryptionSpecificationToKotlin
import com.pulumi.awsnative.cassandra.kotlin.outputs.TableReplicaSpecification.Companion.toKotlin as tableReplicaSpecificationToKotlin
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin

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

    public var args: TableArgs = TableArgs()

    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 TableArgsBuilder.() -> Unit) {
        val builder = TableArgsBuilder()
        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(): Table {
        val builtJavaResource = com.pulumi.awsnative.cassandra.Table(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return Table(builtJavaResource)
    }
}

/**
 * Resource schema for AWS::Cassandra::Table
 * ## Example Usage
 * ### Example
 * No Java example available.
 * ### Example
 * No Java example available.
 * ### Example
 * No Java example available.
 * ### Example
 * No Java example available.
 * ### Example
 * No Java example available.
 * ### Example
 * No Java example available.
 * ### Example
 * No Java example available.
 * ### Example
 * No Java example available.
 * ### Example
 * No Java example available.
 * ### Example
 * No Java example available.
 */
public class Table internal constructor(
    override val javaResource: com.pulumi.awsnative.cassandra.Table,
) : KotlinCustomResource(javaResource, TableMapper) {
    /**
     * The optional auto scaling capacity settings for a table in provisioned capacity mode.
     */
    public val autoScalingSpecifications: Output?
        get() = javaResource.autoScalingSpecifications().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> tableAutoScalingSpecificationToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * The billing mode for the table, which determines how you'll be charged for reads and writes:
     * - *On-demand mode* (default) - You pay based on the actual reads and writes your application performs.
     * - *Provisioned mode* - Lets you specify the number of reads and writes per second that you need for your application.
     * If you don't specify a value for this property, then the table will use on-demand mode.
     */
    public val billingMode: Output?
        get() = javaResource.billingMode().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    tableBillingModeToKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * Indicates whether client side timestamps are enabled (true) or disabled (false) on the table. False by default, once it is enabled it cannot be disabled again.
     */
    public val clientSideTimestampsEnabled: Output?
        get() = javaResource.clientSideTimestampsEnabled().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Clustering key columns of the table
     */
    public val clusteringKeyColumns: Output>?
        get() = javaResource.clusteringKeyColumns().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 ->
                        tableClusteringKeyColumnToKotlin(args0)
                    })
                })
            }).orElse(null)
        })

    /**
     * Default TTL (Time To Live) in seconds, where zero is disabled. If the value is greater than zero, TTL is enabled for the entire table and an expiration timestamp is added to each column.
     */
    public val defaultTimeToLive: Output?
        get() = javaResource.defaultTimeToLive().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The encryption at rest options for the table.
     * - *AWS owned key* (default) - The key is owned by Amazon Keyspaces .
     * - *Customer managed key* - The key is stored in your account and is created, owned, and managed by you.
     * > If you choose encryption with a customer managed key, you must specify a valid customer managed KMS key with permissions granted to Amazon Keyspaces.
     * For more information, see [Encryption at rest in Amazon Keyspaces](https://docs.aws.amazon.com/keyspaces/latest/devguide/EncryptionAtRest.html) in the *Amazon Keyspaces Developer Guide* .
     */
    public val encryptionSpecification: Output?
        get() = javaResource.encryptionSpecification().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> tableEncryptionSpecificationToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * Name for Cassandra keyspace
     */
    public val keyspaceName: Output
        get() = javaResource.keyspaceName().applyValue({ args0 -> args0 })

    /**
     * Partition key columns of the table
     */
    public val partitionKeyColumns: Output>
        get() = javaResource.partitionKeyColumns().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> tableColumnToKotlin(args0) })
            })
        })

    /**
     * Indicates whether point in time recovery is enabled (true) or disabled (false) on the table
     */
    public val pointInTimeRecoveryEnabled: Output?
        get() = javaResource.pointInTimeRecoveryEnabled().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Non-key columns of the table
     */
    public val regularColumns: Output>?
        get() = javaResource.regularColumns().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 -> args0.let({ args0 -> tableColumnToKotlin(args0) }) })
            }).orElse(null)
        })

    /**
     * The AWS Region specific settings of a multi-Region table.
     * For a multi-Region table, you can configure the table's read capacity differently per AWS Region. You can do this by configuring the following parameters.
     * - `region` : The Region where these settings are applied. (Required)
     * - `readCapacityUnits` : The provisioned read capacity units. (Optional)
     * - `readCapacityAutoScaling` : The read capacity auto scaling settings for the table. (Optional)
     */
    public val replicaSpecifications: Output>?
        get() = javaResource.replicaSpecifications().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 ->
                        tableReplicaSpecificationToKotlin(args0)
                    })
                })
            }).orElse(null)
        })

    /**
     * Name for Cassandra table
     */
    public val tableName: Output?
        get() = javaResource.tableName().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * An array of key-value pairs to apply to this resource
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> tagToKotlin(args0) })
                })
            }).orElse(null)
        })
}

public object TableMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.cassandra.Table::class == javaResource::class

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

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

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