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

com.pulumi.gcp.redis.kotlin.inputs.ClusterCrossClusterReplicationConfigArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 8.13.1.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.redis.kotlin.inputs

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.redis.inputs.ClusterCrossClusterReplicationConfigArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 *
 * @property clusterRole The role of the cluster in cross cluster replication. Supported values are:
 * 1. `CLUSTER_ROLE_UNSPECIFIED`: This is an independent cluster that has never participated in cross cluster replication. It allows both reads and writes.
 * 1. `NONE`: This is an independent cluster that previously participated in cross cluster replication(either as a `PRIMARY` or `SECONDARY` cluster). It allows both reads and writes.
 * 1. `PRIMARY`: This cluster serves as the replication source for secondary clusters that are replicating from it. Any data written to it is automatically replicated to its secondary clusters. It allows both reads and writes.
 * 1. `SECONDARY`: This cluster replicates data from the primary cluster. It allows only reads.
 * Possible values are: `CLUSTER_ROLE_UNSPECIFIED`, `NONE`, `PRIMARY`, `SECONDARY`.
 * @property memberships (Output)
 * An output only view of all the member clusters participating in cross cluster replication. This field is populated for all the member clusters irrespective of their cluster role.
 * Structure is documented below.
 * @property primaryCluster Details of the primary cluster that is used as the replication source for this secondary cluster. This is allowed to be set only for clusters whose cluster role is of type `SECONDARY`.
 * Structure is documented below.
 * @property secondaryClusters List of secondary clusters that are replicating from this primary cluster. This is allowed to be set only for clusters whose cluster role is of type `PRIMARY`.
 * Structure is documented below.
 * @property updateTime (Output)
 * The last time cross cluster replication config was updated.
 */
public data class ClusterCrossClusterReplicationConfigArgs(
    public val clusterRole: Output? = null,
    public val memberships: Output>? = null,
    public val primaryCluster: Output? = null,
    public val secondaryClusters: Output>? = null,
    public val updateTime: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.redis.inputs.ClusterCrossClusterReplicationConfigArgs =
        com.pulumi.gcp.redis.inputs.ClusterCrossClusterReplicationConfigArgs.builder()
            .clusterRole(clusterRole?.applyValue({ args0 -> args0 }))
            .memberships(
                memberships?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .primaryCluster(primaryCluster?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .secondaryClusters(
                secondaryClusters?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .updateTime(updateTime?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [ClusterCrossClusterReplicationConfigArgs].
 */
@PulumiTagMarker
public class ClusterCrossClusterReplicationConfigArgsBuilder internal constructor() {
    private var clusterRole: Output? = null

    private var memberships: Output>? = null

    private var primaryCluster: Output? = null

    private var secondaryClusters:
        Output>? = null

    private var updateTime: Output? = null

    /**
     * @param value The role of the cluster in cross cluster replication. Supported values are:
     * 1. `CLUSTER_ROLE_UNSPECIFIED`: This is an independent cluster that has never participated in cross cluster replication. It allows both reads and writes.
     * 1. `NONE`: This is an independent cluster that previously participated in cross cluster replication(either as a `PRIMARY` or `SECONDARY` cluster). It allows both reads and writes.
     * 1. `PRIMARY`: This cluster serves as the replication source for secondary clusters that are replicating from it. Any data written to it is automatically replicated to its secondary clusters. It allows both reads and writes.
     * 1. `SECONDARY`: This cluster replicates data from the primary cluster. It allows only reads.
     * Possible values are: `CLUSTER_ROLE_UNSPECIFIED`, `NONE`, `PRIMARY`, `SECONDARY`.
     */
    @JvmName("lqxdwnfvvjuvxugg")
    public suspend fun clusterRole(`value`: Output) {
        this.clusterRole = value
    }

    /**
     * @param value (Output)
     * An output only view of all the member clusters participating in cross cluster replication. This field is populated for all the member clusters irrespective of their cluster role.
     * Structure is documented below.
     */
    @JvmName("qnhstnbokfbbofrd")
    public suspend fun memberships(`value`: Output>) {
        this.memberships = value
    }

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

    /**
     * @param values (Output)
     * An output only view of all the member clusters participating in cross cluster replication. This field is populated for all the member clusters irrespective of their cluster role.
     * Structure is documented below.
     */
    @JvmName("acyofaypbfiamrey")
    public suspend fun memberships(values: List>) {
        this.memberships = Output.all(values)
    }

    /**
     * @param value Details of the primary cluster that is used as the replication source for this secondary cluster. This is allowed to be set only for clusters whose cluster role is of type `SECONDARY`.
     * Structure is documented below.
     */
    @JvmName("kglfseytkbopjonl")
    public suspend fun primaryCluster(`value`: Output) {
        this.primaryCluster = value
    }

    /**
     * @param value List of secondary clusters that are replicating from this primary cluster. This is allowed to be set only for clusters whose cluster role is of type `PRIMARY`.
     * Structure is documented below.
     */
    @JvmName("cycwxsuiwsdfrypo")
    public suspend fun secondaryClusters(`value`: Output>) {
        this.secondaryClusters = value
    }

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

    /**
     * @param values List of secondary clusters that are replicating from this primary cluster. This is allowed to be set only for clusters whose cluster role is of type `PRIMARY`.
     * Structure is documented below.
     */
    @JvmName("lxeyiplpqgexooim")
    public suspend fun secondaryClusters(values: List>) {
        this.secondaryClusters = Output.all(values)
    }

    /**
     * @param value (Output)
     * The last time cross cluster replication config was updated.
     */
    @JvmName("fvkjlehivrcyqbpb")
    public suspend fun updateTime(`value`: Output) {
        this.updateTime = value
    }

    /**
     * @param value The role of the cluster in cross cluster replication. Supported values are:
     * 1. `CLUSTER_ROLE_UNSPECIFIED`: This is an independent cluster that has never participated in cross cluster replication. It allows both reads and writes.
     * 1. `NONE`: This is an independent cluster that previously participated in cross cluster replication(either as a `PRIMARY` or `SECONDARY` cluster). It allows both reads and writes.
     * 1. `PRIMARY`: This cluster serves as the replication source for secondary clusters that are replicating from it. Any data written to it is automatically replicated to its secondary clusters. It allows both reads and writes.
     * 1. `SECONDARY`: This cluster replicates data from the primary cluster. It allows only reads.
     * Possible values are: `CLUSTER_ROLE_UNSPECIFIED`, `NONE`, `PRIMARY`, `SECONDARY`.
     */
    @JvmName("frcspbjtasiuifsp")
    public suspend fun clusterRole(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.clusterRole = mapped
    }

    /**
     * @param value (Output)
     * An output only view of all the member clusters participating in cross cluster replication. This field is populated for all the member clusters irrespective of their cluster role.
     * Structure is documented below.
     */
    @JvmName("omntkghnkggfwrbg")
    public suspend fun memberships(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.memberships = mapped
    }

    /**
     * @param argument (Output)
     * An output only view of all the member clusters participating in cross cluster replication. This field is populated for all the member clusters irrespective of their cluster role.
     * Structure is documented below.
     */
    @JvmName("hijffijvrpwpolec")
    public suspend fun memberships(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            ClusterCrossClusterReplicationConfigMembershipArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.memberships = mapped
    }

    /**
     * @param argument (Output)
     * An output only view of all the member clusters participating in cross cluster replication. This field is populated for all the member clusters irrespective of their cluster role.
     * Structure is documented below.
     */
    @JvmName("afceeivbknfvmbfq")
    public suspend fun memberships(vararg argument: suspend ClusterCrossClusterReplicationConfigMembershipArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            ClusterCrossClusterReplicationConfigMembershipArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.memberships = mapped
    }

    /**
     * @param argument (Output)
     * An output only view of all the member clusters participating in cross cluster replication. This field is populated for all the member clusters irrespective of their cluster role.
     * Structure is documented below.
     */
    @JvmName("urgfpdgaecuqureq")
    public suspend fun memberships(argument: suspend ClusterCrossClusterReplicationConfigMembershipArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            ClusterCrossClusterReplicationConfigMembershipArgsBuilder().applySuspend
                { argument() }.build(),
        )
        val mapped = of(toBeMapped)
        this.memberships = mapped
    }

    /**
     * @param values (Output)
     * An output only view of all the member clusters participating in cross cluster replication. This field is populated for all the member clusters irrespective of their cluster role.
     * Structure is documented below.
     */
    @JvmName("jdsjxfbinimiwwdi")
    public suspend fun memberships(vararg values: ClusterCrossClusterReplicationConfigMembershipArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.memberships = mapped
    }

    /**
     * @param value Details of the primary cluster that is used as the replication source for this secondary cluster. This is allowed to be set only for clusters whose cluster role is of type `SECONDARY`.
     * Structure is documented below.
     */
    @JvmName("ybleaspwpldmlpdu")
    public suspend fun primaryCluster(`value`: ClusterCrossClusterReplicationConfigPrimaryClusterArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.primaryCluster = mapped
    }

    /**
     * @param argument Details of the primary cluster that is used as the replication source for this secondary cluster. This is allowed to be set only for clusters whose cluster role is of type `SECONDARY`.
     * Structure is documented below.
     */
    @JvmName("tsxvabiniqtrlfse")
    public suspend fun primaryCluster(argument: suspend ClusterCrossClusterReplicationConfigPrimaryClusterArgsBuilder.() -> Unit) {
        val toBeMapped = ClusterCrossClusterReplicationConfigPrimaryClusterArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.primaryCluster = mapped
    }

    /**
     * @param value List of secondary clusters that are replicating from this primary cluster. This is allowed to be set only for clusters whose cluster role is of type `PRIMARY`.
     * Structure is documented below.
     */
    @JvmName("alfnewadbdcrfpyt")
    public suspend fun secondaryClusters(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.secondaryClusters = mapped
    }

    /**
     * @param argument List of secondary clusters that are replicating from this primary cluster. This is allowed to be set only for clusters whose cluster role is of type `PRIMARY`.
     * Structure is documented below.
     */
    @JvmName("xshdwqgwpplaiumn")
    public suspend fun secondaryClusters(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            ClusterCrossClusterReplicationConfigSecondaryClusterArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.secondaryClusters = mapped
    }

    /**
     * @param argument List of secondary clusters that are replicating from this primary cluster. This is allowed to be set only for clusters whose cluster role is of type `PRIMARY`.
     * Structure is documented below.
     */
    @JvmName("onqjgkhgporbjegi")
    public suspend fun secondaryClusters(vararg argument: suspend ClusterCrossClusterReplicationConfigSecondaryClusterArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            ClusterCrossClusterReplicationConfigSecondaryClusterArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.secondaryClusters = mapped
    }

    /**
     * @param argument List of secondary clusters that are replicating from this primary cluster. This is allowed to be set only for clusters whose cluster role is of type `PRIMARY`.
     * Structure is documented below.
     */
    @JvmName("sptvmwboqojeseie")
    public suspend fun secondaryClusters(argument: suspend ClusterCrossClusterReplicationConfigSecondaryClusterArgsBuilder.() -> Unit) {
        val toBeMapped =
            listOf(
                ClusterCrossClusterReplicationConfigSecondaryClusterArgsBuilder().applySuspend {
                    argument()
                }.build(),
            )
        val mapped = of(toBeMapped)
        this.secondaryClusters = mapped
    }

    /**
     * @param values List of secondary clusters that are replicating from this primary cluster. This is allowed to be set only for clusters whose cluster role is of type `PRIMARY`.
     * Structure is documented below.
     */
    @JvmName("jutoyilpjlcpvqer")
    public suspend fun secondaryClusters(vararg values: ClusterCrossClusterReplicationConfigSecondaryClusterArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.secondaryClusters = mapped
    }

    /**
     * @param value (Output)
     * The last time cross cluster replication config was updated.
     */
    @JvmName("ftbcydrlioavjuwy")
    public suspend fun updateTime(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.updateTime = mapped
    }

    internal fun build(): ClusterCrossClusterReplicationConfigArgs =
        ClusterCrossClusterReplicationConfigArgs(
            clusterRole = clusterRole,
            memberships = memberships,
            primaryCluster = primaryCluster,
            secondaryClusters = secondaryClusters,
            updateTime = updateTime,
        )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy