com.pulumi.alicloud.ots.kotlin.TableArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-alicloud-kotlin Show documentation
Show all versions of pulumi-alicloud-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.alicloud.ots.kotlin
import com.pulumi.alicloud.ots.TableArgs.builder
import com.pulumi.alicloud.ots.kotlin.inputs.TableDefinedColumnArgs
import com.pulumi.alicloud.ots.kotlin.inputs.TableDefinedColumnArgsBuilder
import com.pulumi.alicloud.ots.kotlin.inputs.TablePrimaryKeyArgs
import com.pulumi.alicloud.ots.kotlin.inputs.TablePrimaryKeyArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName
/**
* Provides an OTS table resource.
* > **NOTE:** From Provider version 1.10.0, the provider field 'ots_instance_name' has been deprecated and
* you should use resource alicloud_ots_table's new field 'instance_name' and 'table_name' to re-import this resource.
* > **NOTE:** Available since v1.9.2.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as alicloud from "@pulumi/alicloud";
* import * as random from "@pulumi/random";
* const config = new pulumi.Config();
* const name = config.get("name") || "tf-example";
* const _default = new random.index.Integer("default", {
* min: 10000,
* max: 99999,
* });
* const defaultInstance = new alicloud.ots.Instance("default", {
* name: `${name}-${_default.result}`,
* description: name,
* accessedBy: "Any",
* tags: {
* Created: "TF",
* For: "example",
* },
* });
* const defaultTable = new alicloud.ots.Table("default", {
* instanceName: defaultInstance.name,
* tableName: "tf_example",
* timeToLive: -1,
* maxVersion: 1,
* enableSse: true,
* sseKeyType: "SSE_KMS_SERVICE",
* primaryKeys: [
* {
* name: "pk1",
* type: "Integer",
* },
* {
* name: "pk2",
* type: "String",
* },
* {
* name: "pk3",
* type: "Binary",
* },
* ],
* definedColumns: [
* {
* name: "col1",
* type: "Integer",
* },
* {
* name: "col2",
* type: "String",
* },
* {
* name: "col3",
* type: "Binary",
* },
* ],
* });
* ```
* ```python
* import pulumi
* import pulumi_alicloud as alicloud
* import pulumi_random as random
* config = pulumi.Config()
* name = config.get("name")
* if name is None:
* name = "tf-example"
* default = random.index.Integer("default",
* min=10000,
* max=99999)
* default_instance = alicloud.ots.Instance("default",
* name=f"{name}-{default['result']}",
* description=name,
* accessed_by="Any",
* tags={
* "Created": "TF",
* "For": "example",
* })
* default_table = alicloud.ots.Table("default",
* instance_name=default_instance.name,
* table_name="tf_example",
* time_to_live=-1,
* max_version=1,
* enable_sse=True,
* sse_key_type="SSE_KMS_SERVICE",
* primary_keys=[
* {
* "name": "pk1",
* "type": "Integer",
* },
* {
* "name": "pk2",
* "type": "String",
* },
* {
* "name": "pk3",
* "type": "Binary",
* },
* ],
* defined_columns=[
* {
* "name": "col1",
* "type": "Integer",
* },
* {
* "name": "col2",
* "type": "String",
* },
* {
* "name": "col3",
* "type": "Binary",
* },
* ])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using AliCloud = Pulumi.AliCloud;
* using Random = Pulumi.Random;
* return await Deployment.RunAsync(() =>
* {
* var config = new Config();
* var name = config.Get("name") ?? "tf-example";
* var @default = new Random.Index.Integer("default", new()
* {
* Min = 10000,
* Max = 99999,
* });
* var defaultInstance = new AliCloud.Ots.Instance("default", new()
* {
* Name = $"{name}-{@default.Result}",
* Description = name,
* AccessedBy = "Any",
* Tags =
* {
* { "Created", "TF" },
* { "For", "example" },
* },
* });
* var defaultTable = new AliCloud.Ots.Table("default", new()
* {
* InstanceName = defaultInstance.Name,
* TableName = "tf_example",
* TimeToLive = -1,
* MaxVersion = 1,
* EnableSse = true,
* SseKeyType = "SSE_KMS_SERVICE",
* PrimaryKeys = new[]
* {
* new AliCloud.Ots.Inputs.TablePrimaryKeyArgs
* {
* Name = "pk1",
* Type = "Integer",
* },
* new AliCloud.Ots.Inputs.TablePrimaryKeyArgs
* {
* Name = "pk2",
* Type = "String",
* },
* new AliCloud.Ots.Inputs.TablePrimaryKeyArgs
* {
* Name = "pk3",
* Type = "Binary",
* },
* },
* DefinedColumns = new[]
* {
* new AliCloud.Ots.Inputs.TableDefinedColumnArgs
* {
* Name = "col1",
* Type = "Integer",
* },
* new AliCloud.Ots.Inputs.TableDefinedColumnArgs
* {
* Name = "col2",
* Type = "String",
* },
* new AliCloud.Ots.Inputs.TableDefinedColumnArgs
* {
* Name = "col3",
* Type = "Binary",
* },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "fmt"
* "github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ots"
* "github.com/pulumi/pulumi-random/sdk/v4/go/random"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* cfg := config.New(ctx, "")
* name := "tf-example"
* if param := cfg.Get("name"); param != "" {
* name = param
* }
* _, err := random.NewInteger(ctx, "default", &random.IntegerArgs{
* Min: 10000,
* Max: 99999,
* })
* if err != nil {
* return err
* }
* defaultInstance, err := ots.NewInstance(ctx, "default", &ots.InstanceArgs{
* Name: pulumi.Sprintf("%v-%v", name, _default.Result),
* Description: pulumi.String(name),
* AccessedBy: pulumi.String("Any"),
* Tags: pulumi.StringMap{
* "Created": pulumi.String("TF"),
* "For": pulumi.String("example"),
* },
* })
* if err != nil {
* return err
* }
* _, err = ots.NewTable(ctx, "default", &ots.TableArgs{
* InstanceName: defaultInstance.Name,
* TableName: pulumi.String("tf_example"),
* TimeToLive: int(-1),
* MaxVersion: pulumi.Int(1),
* EnableSse: pulumi.Bool(true),
* SseKeyType: pulumi.String("SSE_KMS_SERVICE"),
* PrimaryKeys: ots.TablePrimaryKeyArray{
* &ots.TablePrimaryKeyArgs{
* Name: pulumi.String("pk1"),
* Type: pulumi.String("Integer"),
* },
* &ots.TablePrimaryKeyArgs{
* Name: pulumi.String("pk2"),
* Type: pulumi.String("String"),
* },
* &ots.TablePrimaryKeyArgs{
* Name: pulumi.String("pk3"),
* Type: pulumi.String("Binary"),
* },
* },
* DefinedColumns: ots.TableDefinedColumnArray{
* &ots.TableDefinedColumnArgs{
* Name: pulumi.String("col1"),
* Type: pulumi.String("Integer"),
* },
* &ots.TableDefinedColumnArgs{
* Name: pulumi.String("col2"),
* Type: pulumi.String("String"),
* },
* &ots.TableDefinedColumnArgs{
* Name: pulumi.String("col3"),
* Type: pulumi.String("Binary"),
* },
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```yaml
* configuration:
* name:
* type: string
* default: tf-example
* resources:
* default:
* type: random:integer
* properties:
* min: 10000
* max: 99999
* defaultInstance:
* type: alicloud:ots:Instance
* name: default
* properties:
* name: ${name}-${default.result}
* description: ${name}
* accessedBy: Any
* tags:
* Created: TF
* For: example
* defaultTable:
* type: alicloud:ots:Table
* name: default
* properties:
* instanceName: ${defaultInstance.name}
* tableName: tf_example
* timeToLive: -1
* maxVersion: 1
* enableSse: true
* sseKeyType: SSE_KMS_SERVICE
* primaryKeys:
* - name: pk1
* type: Integer
* - name: pk2
* type: String
* - name: pk3
* type: Binary
* definedColumns:
* - name: col1
* type: Integer
* - name: col2
* type: String
* - name: col3
* type: Binary
* ```
*
* ## Import
* OTS table can be imported using id, e.g.
* ```sh
* $ pulumi import alicloud:ots/table:Table table my-ots:ots_table
* ```
* @property allowUpdate Whether allow data update operations. Default value is true. Skipping the resource state refresh step may result in unnecessary execution plan when upgrading from an earlier version.
* @property definedColumns The property of `TableMeta` which indicates the structure information of a table. It describes the attribute value of defined column. The number of `defined_column` should not be more than 32. See `defined_column` below.
* @property deviationCellVersionInSec The max version offset of the table. The valid value is 1-9223372036854775807. Defaults to 86400.
* @property enableSse Whether enable OTS server side encryption. Default value is false.
* @property instanceName The name of the OTS instance in which table will located.
* @property maxVersion The maximum number of versions stored in this table. The valid value is 1-2147483647.
* @property primaryKeys The property of `TableMeta` which indicates the structure information of a table. It describes the attribute value of primary key. The number of `primary_key` should not be less than one and not be more than four. See `primary_key` below.
* @property sseKeyId . The key ID of secret. `sse_key_id` is valid only when `sse_key_type` is set to `SSE_BYOK`.
* @property sseKeyType The key type of OTS server side encryption. `SSE_KMS_SERVICE`, `SSE_BYOK` is allowed.
* @property sseRoleArn The arn of role that can access kms service. `sse_role_arn` is valid only when `sse_key_type` is set to `SSE_BYOK`.
* @property tableName The table name of the OTS instance. If changed, a new table would be created.
* @property timeToLive The retention time of data stored in this table (unit: second). The value maximum is 2147483647 and -1 means never expired.
*/
public data class TableArgs(
public val allowUpdate: Output? = null,
public val definedColumns: Output>? = null,
public val deviationCellVersionInSec: Output? = null,
public val enableSse: Output? = null,
public val instanceName: Output? = null,
public val maxVersion: Output? = null,
public val primaryKeys: Output>? = null,
public val sseKeyId: Output? = null,
public val sseKeyType: Output? = null,
public val sseRoleArn: Output? = null,
public val tableName: Output? = null,
public val timeToLive: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.alicloud.ots.TableArgs =
com.pulumi.alicloud.ots.TableArgs.builder()
.allowUpdate(allowUpdate?.applyValue({ args0 -> args0 }))
.definedColumns(
definedColumns?.applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
args0.toJava()
})
})
}),
)
.deviationCellVersionInSec(deviationCellVersionInSec?.applyValue({ args0 -> args0 }))
.enableSse(enableSse?.applyValue({ args0 -> args0 }))
.instanceName(instanceName?.applyValue({ args0 -> args0 }))
.maxVersion(maxVersion?.applyValue({ args0 -> args0 }))
.primaryKeys(
primaryKeys?.applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
args0.toJava()
})
})
}),
)
.sseKeyId(sseKeyId?.applyValue({ args0 -> args0 }))
.sseKeyType(sseKeyType?.applyValue({ args0 -> args0 }))
.sseRoleArn(sseRoleArn?.applyValue({ args0 -> args0 }))
.tableName(tableName?.applyValue({ args0 -> args0 }))
.timeToLive(timeToLive?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [TableArgs].
*/
@PulumiTagMarker
public class TableArgsBuilder internal constructor() {
private var allowUpdate: Output? = null
private var definedColumns: Output>? = null
private var deviationCellVersionInSec: Output? = null
private var enableSse: Output? = null
private var instanceName: Output? = null
private var maxVersion: Output? = null
private var primaryKeys: Output>? = null
private var sseKeyId: Output? = null
private var sseKeyType: Output? = null
private var sseRoleArn: Output? = null
private var tableName: Output? = null
private var timeToLive: Output? = null
/**
* @param value Whether allow data update operations. Default value is true. Skipping the resource state refresh step may result in unnecessary execution plan when upgrading from an earlier version.
*/
@JvmName("hoayjuhemjaefvth")
public suspend fun allowUpdate(`value`: Output) {
this.allowUpdate = value
}
/**
* @param value The property of `TableMeta` which indicates the structure information of a table. It describes the attribute value of defined column. The number of `defined_column` should not be more than 32. See `defined_column` below.
*/
@JvmName("lcbrjrxmehmawxvp")
public suspend fun definedColumns(`value`: Output>) {
this.definedColumns = value
}
@JvmName("temmldjuklgbfpdr")
public suspend fun definedColumns(vararg values: Output) {
this.definedColumns = Output.all(values.asList())
}
/**
* @param values The property of `TableMeta` which indicates the structure information of a table. It describes the attribute value of defined column. The number of `defined_column` should not be more than 32. See `defined_column` below.
*/
@JvmName("fgpsirxcrvvnskku")
public suspend fun definedColumns(values: List