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

com.pulumi.gcp.spanner.kotlin.InstanceConfigArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.gcp.spanner.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.spanner.InstanceConfigArgs.builder
import com.pulumi.gcp.spanner.kotlin.inputs.InstanceConfigReplicaArgs
import com.pulumi.gcp.spanner.kotlin.inputs.InstanceConfigReplicaArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * A possible configuration for a Cloud Spanner instance. Configurations
 * define the geographic placement of nodes and their replication.
 * To get more information about InstanceConfig, see:
 * * [API documentation](https://cloud.google.com/spanner/docs/reference/rest/v1/projects.instanceConfigs)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/spanner/)
 * ## Example Usage
 * ## Import
 * InstanceConfig can be imported using any of these accepted formats:
 * * `projects/{{project}}/instanceConfigs/{{name}}`
 * * `{{project}}/{{name}}`
 * * `{{name}}`
 * When using the `pulumi import` command, InstanceConfig can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:spanner/instanceConfig:InstanceConfig default projects/{{project}}/instanceConfigs/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:spanner/instanceConfig:InstanceConfig default {{project}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:spanner/instanceConfig:InstanceConfig default {{name}}
 * ```
 * @property baseConfig Base configuration name, e.g. nam3, based on which this configuration is created. Only set for user managed
 * configurations. baseConfig must refer to a configuration of type GOOGLE_MANAGED in the same project as this
 * configuration.
 * @property displayName The name of this instance configuration as it appears in UIs.
 * @property labels An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.
 * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer
 * to the field 'effective_labels' for all of the labels present on the resource.
 * @property name A unique identifier for the instance configuration. Values are of the
 * form projects//instanceConfigs/[a-z][-a-z0-9]*
 * @property project
 * @property replicas The geographic placement of nodes in this instance configuration and their replication properties.
 * Structure is documented below.
 */
public data class InstanceConfigArgs(
    public val baseConfig: Output? = null,
    public val displayName: Output? = null,
    public val labels: Output>? = null,
    public val name: Output? = null,
    public val project: Output? = null,
    public val replicas: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.spanner.InstanceConfigArgs =
        com.pulumi.gcp.spanner.InstanceConfigArgs.builder()
            .baseConfig(baseConfig?.applyValue({ args0 -> args0 }))
            .displayName(displayName?.applyValue({ args0 -> args0 }))
            .labels(labels?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .name(name?.applyValue({ args0 -> args0 }))
            .project(project?.applyValue({ args0 -> args0 }))
            .replicas(
                replicas?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            ).build()
}

/**
 * Builder for [InstanceConfigArgs].
 */
@PulumiTagMarker
public class InstanceConfigArgsBuilder internal constructor() {
    private var baseConfig: Output? = null

    private var displayName: Output? = null

    private var labels: Output>? = null

    private var name: Output? = null

    private var project: Output? = null

    private var replicas: Output>? = null

    /**
     * @param value Base configuration name, e.g. nam3, based on which this configuration is created. Only set for user managed
     * configurations. baseConfig must refer to a configuration of type GOOGLE_MANAGED in the same project as this
     * configuration.
     */
    @JvmName("vookthvhtvlklhnw")
    public suspend fun baseConfig(`value`: Output) {
        this.baseConfig = value
    }

    /**
     * @param value The name of this instance configuration as it appears in UIs.
     */
    @JvmName("xkxdfjelushpyefi")
    public suspend fun displayName(`value`: Output) {
        this.displayName = value
    }

    /**
     * @param value An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.
     * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer
     * to the field 'effective_labels' for all of the labels present on the resource.
     */
    @JvmName("rglobamciahqsnfp")
    public suspend fun labels(`value`: Output>) {
        this.labels = value
    }

    /**
     * @param value A unique identifier for the instance configuration. Values are of the
     * form projects//instanceConfigs/[a-z][-a-z0-9]*
     */
    @JvmName("jppkmfrlgratagrh")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value
     */
    @JvmName("ieinlrbbrtamalgi")
    public suspend fun project(`value`: Output) {
        this.project = value
    }

    /**
     * @param value The geographic placement of nodes in this instance configuration and their replication properties.
     * Structure is documented below.
     */
    @JvmName("hqtbhvnjfhhhrogk")
    public suspend fun replicas(`value`: Output>) {
        this.replicas = value
    }

    @JvmName("uroebqpjfxqbwfyp")
    public suspend fun replicas(vararg values: Output) {
        this.replicas = Output.all(values.asList())
    }

    /**
     * @param values The geographic placement of nodes in this instance configuration and their replication properties.
     * Structure is documented below.
     */
    @JvmName("qscfcevwywcktqem")
    public suspend fun replicas(values: List>) {
        this.replicas = Output.all(values)
    }

    /**
     * @param value Base configuration name, e.g. nam3, based on which this configuration is created. Only set for user managed
     * configurations. baseConfig must refer to a configuration of type GOOGLE_MANAGED in the same project as this
     * configuration.
     */
    @JvmName("qrkhnsudwhlmihfd")
    public suspend fun baseConfig(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.baseConfig = mapped
    }

    /**
     * @param value The name of this instance configuration as it appears in UIs.
     */
    @JvmName("glocnomjtcucnovj")
    public suspend fun displayName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.displayName = mapped
    }

    /**
     * @param value An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.
     * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer
     * to the field 'effective_labels' for all of the labels present on the resource.
     */
    @JvmName("iamhdhhkrdtuusct")
    public suspend fun labels(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param values An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.
     * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer
     * to the field 'effective_labels' for all of the labels present on the resource.
     */
    @JvmName("jmeannynwmavqjtk")
    public fun labels(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param value A unique identifier for the instance configuration. Values are of the
     * form projects//instanceConfigs/[a-z][-a-z0-9]*
     */
    @JvmName("pjfqobtfbepflejd")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value
     */
    @JvmName("nmykemajdjfkthfx")
    public suspend fun project(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.project = mapped
    }

    /**
     * @param value The geographic placement of nodes in this instance configuration and their replication properties.
     * Structure is documented below.
     */
    @JvmName("arnjtdjvthmqdblh")
    public suspend fun replicas(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.replicas = mapped
    }

    /**
     * @param argument The geographic placement of nodes in this instance configuration and their replication properties.
     * Structure is documented below.
     */
    @JvmName("mwjtmuteukonqhds")
    public suspend fun replicas(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            InstanceConfigReplicaArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.replicas = mapped
    }

    /**
     * @param argument The geographic placement of nodes in this instance configuration and their replication properties.
     * Structure is documented below.
     */
    @JvmName("nbxtbmsqcolradxe")
    public suspend fun replicas(vararg argument: suspend InstanceConfigReplicaArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            InstanceConfigReplicaArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.replicas = mapped
    }

    /**
     * @param argument The geographic placement of nodes in this instance configuration and their replication properties.
     * Structure is documented below.
     */
    @JvmName("tydppscsepiesklo")
    public suspend fun replicas(argument: suspend InstanceConfigReplicaArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(InstanceConfigReplicaArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.replicas = mapped
    }

    /**
     * @param values The geographic placement of nodes in this instance configuration and their replication properties.
     * Structure is documented below.
     */
    @JvmName("acxkpdsfvkehgnaa")
    public suspend fun replicas(vararg values: InstanceConfigReplicaArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.replicas = mapped
    }

    internal fun build(): InstanceConfigArgs = InstanceConfigArgs(
        baseConfig = baseConfig,
        displayName = displayName,
        labels = labels,
        name = name,
        project = project,
        replicas = replicas,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy