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

com.pulumi.awsnative.msk.kotlin.VpcConnection.kt Maven / Gradle / Ivy

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

package com.pulumi.awsnative.msk.kotlin

import com.pulumi.awsnative.msk.kotlin.enums.VpcConnectionAuthentication
import com.pulumi.awsnative.msk.kotlin.enums.VpcConnectionAuthentication.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
import kotlin.collections.List
import kotlin.collections.Map

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

    public var args: VpcConnectionArgs = VpcConnectionArgs()

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

/**
 * Resource Type definition for AWS::MSK::VpcConnection
 */
public class VpcConnection internal constructor(
    override val javaResource: com.pulumi.awsnative.msk.VpcConnection,
) : KotlinCustomResource(javaResource, VpcConnectionMapper) {
    /**
     * The ARN of the VPC connection.
     */
    public val arn: Output
        get() = javaResource.arn().applyValue({ args0 -> args0 })

    /**
     * The type of private link authentication.
     */
    public val authentication: Output
        get() = javaResource.authentication().applyValue({ args0 ->
            args0.let({ args0 ->
                toKotlin(args0)
            })
        })

    /**
     * The list of subnets in the client VPC to connect to.
     */
    public val clientSubnets: Output>
        get() = javaResource.clientSubnets().applyValue({ args0 -> args0.map({ args0 -> args0 }) })

    /**
     * The security groups to attach to the ENIs for the broker nodes.
     */
    public val securityGroups: Output>
        get() = javaResource.securityGroups().applyValue({ args0 -> args0.map({ args0 -> args0 }) })

    /**
     * Create tags when creating the VPC connection.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

    /**
     * The Amazon Resource Name (ARN) of the target cluster
     */
    public val targetClusterArn: Output
        get() = javaResource.targetClusterArn().applyValue({ args0 -> args0 })

    /**
     * The VPC id of the remote client.
     */
    public val vpcId: Output
        get() = javaResource.vpcId().applyValue({ args0 -> args0 })
}

public object VpcConnectionMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.msk.VpcConnection::class == javaResource::class

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy