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

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

package com.pulumi.awsnative.rds.kotlin

import com.pulumi.awsnative.kotlin.outputs.Tag
import com.pulumi.awsnative.rds.kotlin.enums.DbProxyEngineFamily
import com.pulumi.awsnative.rds.kotlin.outputs.DbProxyAuthFormat
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.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin
import com.pulumi.awsnative.rds.kotlin.enums.DbProxyEngineFamily.Companion.toKotlin as dbProxyEngineFamilyToKotlin
import com.pulumi.awsnative.rds.kotlin.outputs.DbProxyAuthFormat.Companion.toKotlin as dbProxyAuthFormatToKotlin

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

    public var args: DbProxyArgs = DbProxyArgs()

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

/**
 * Resource schema for AWS::RDS::DBProxy
 */
public class DbProxy internal constructor(
    override val javaResource: com.pulumi.awsnative.rds.DbProxy,
) : KotlinCustomResource(javaResource, DbProxyMapper) {
    /**
     * The authorization mechanism that the proxy uses.
     */
    public val auth: Output>
        get() = javaResource.auth().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    dbProxyAuthFormatToKotlin(args0)
                })
            })
        })

    /**
     * The Amazon Resource Name (ARN) for the proxy.
     */
    public val dbProxyArn: Output
        get() = javaResource.dbProxyArn().applyValue({ args0 -> args0 })

    /**
     * The identifier for the proxy. This name must be unique for all proxies owned by your AWS account in the specified AWS Region.
     */
    public val dbProxyName: Output
        get() = javaResource.dbProxyName().applyValue({ args0 -> args0 })

    /**
     * Whether the proxy includes detailed information about SQL statements in its logs.
     */
    public val debugLogging: Output?
        get() = javaResource.debugLogging().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The endpoint that you can use to connect to the proxy. You include the endpoint value in the connection string for a database client application.
     */
    public val endpoint: Output
        get() = javaResource.endpoint().applyValue({ args0 -> args0 })

    /**
     * The kinds of databases that the proxy can connect to.
     */
    public val engineFamily: Output
        get() = javaResource.engineFamily().applyValue({ args0 ->
            args0.let({ args0 ->
                dbProxyEngineFamilyToKotlin(args0)
            })
        })

    /**
     * The number of seconds that a connection to the proxy can be inactive before the proxy disconnects it.
     */
    public val idleClientTimeout: Output?
        get() = javaResource.idleClientTimeout().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * A Boolean parameter that specifies whether Transport Layer Security (TLS) encryption is required for connections to the proxy.
     */
    public val requireTls: Output?
        get() = javaResource.requireTls().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The Amazon Resource Name (ARN) of the IAM role that the proxy uses to access secrets in AWS Secrets Manager.
     */
    public val roleArn: Output
        get() = javaResource.roleArn().applyValue({ args0 -> args0 })

    /**
     * An optional set of key-value pairs to associate arbitrary data of your choosing with the proxy.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> tagToKotlin(args0) })
                })
            }).orElse(null)
        })

    /**
     * VPC ID to associate with the new DB proxy.
     */
    public val vpcId: Output
        get() = javaResource.vpcId().applyValue({ args0 -> args0 })

    /**
     * VPC security group IDs to associate with the new proxy.
     */
    public val vpcSecurityGroupIds: Output>?
        get() = javaResource.vpcSecurityGroupIds().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 -> args0 })
            }).orElse(null)
        })

    /**
     * VPC subnet IDs to associate with the new proxy.
     */
    public val vpcSubnetIds: Output>
        get() = javaResource.vpcSubnetIds().applyValue({ args0 -> args0.map({ args0 -> args0 }) })
}

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

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy