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

com.pulumi.awsnative.rds.kotlin.GlobalCluster.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: 1.24.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.awsnative.rds.kotlin

import com.pulumi.awsnative.rds.kotlin.enums.GlobalClusterEngine
import com.pulumi.awsnative.rds.kotlin.enums.GlobalClusterEngine.Companion.toKotlin
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

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

    public var args: GlobalClusterArgs = GlobalClusterArgs()

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

/**
 * Resource Type definition for AWS::RDS::GlobalCluster
 */
public class GlobalCluster internal constructor(
    override val javaResource: com.pulumi.awsnative.rds.GlobalCluster,
) : KotlinCustomResource(javaResource, GlobalClusterMapper) {
    /**
     * The deletion protection setting for the new global database. The global database can't be deleted when deletion protection is enabled.
     */
    public val deletionProtection: Output?
        get() = javaResource.deletionProtection().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The name of the database engine to be used for this DB cluster. Valid Values: aurora (for MySQL 5.6-compatible Aurora), aurora-mysql (for MySQL 5.7-compatible Aurora).
     * If you specify the SourceDBClusterIdentifier property, don't specify this property. The value is inherited from the cluster.
     */
    public val engine: Output?
        get() = javaResource.engine().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    toKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * The life cycle type of the global cluster. You can use this setting to enroll your global cluster into Amazon RDS Extended Support.
     */
    public val engineLifecycleSupport: Output?
        get() = javaResource.engineLifecycleSupport().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The version number of the database engine to use. If you specify the SourceDBClusterIdentifier property, don't specify this property. The value is inherited from the cluster.
     */
    public val engineVersion: Output?
        get() = javaResource.engineVersion().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The cluster identifier of the new global database cluster. This parameter is stored as a lowercase string.
     */
    public val globalClusterIdentifier: Output?
        get() = javaResource.globalClusterIdentifier().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The Amazon Resource Name (ARN) to use as the primary cluster of the global database. This parameter is optional. This parameter is stored as a lowercase string.
     */
    public val sourceDbClusterIdentifier: Output?
        get() = javaResource.sourceDbClusterIdentifier().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     *  The storage encryption setting for the new global database cluster.
     * If you specify the SourceDBClusterIdentifier property, don't specify this property. The value is inherited from the cluster.
     */
    public val storageEncrypted: Output?
        get() = javaResource.storageEncrypted().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })
}

public object GlobalClusterMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.rds.GlobalCluster::class == javaResource::class

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy