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

com.pulumi.awsnative.ec2.kotlin.VpnGateway.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.ec2.kotlin

import com.pulumi.awsnative.kotlin.outputs.Tag
import com.pulumi.awsnative.kotlin.outputs.Tag.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.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List

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

    public var args: VpnGatewayArgs = VpnGatewayArgs()

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

/**
 * Specifies a virtual private gateway. A virtual private gateway is the endpoint on the VPC side of your VPN connection. You can create a virtual private gateway before creating the VPC itself.
 *  For more information, see [](https://docs.aws.amazon.com/vpn/latest/s2svpn/VPC_VPN.html) in the *User Guide*.
 */
public class VpnGateway internal constructor(
    override val javaResource: com.pulumi.awsnative.ec2.VpnGateway,
) : KotlinCustomResource(javaResource, VpnGatewayMapper) {
    /**
     * The private Autonomous System Number (ASN) for the Amazon side of a BGP session.
     */
    public val amazonSideAsn: Output?
        get() = javaResource.amazonSideAsn().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Any tags assigned to the virtual private gateway.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> toKotlin(args0) })
                })
            }).orElse(null)
        })

    /**
     * The type of VPN connection the virtual private gateway supports.
     */
    public val type: Output
        get() = javaResource.type().applyValue({ args0 -> args0 })

    /**
     * The ID of the VPN gateway.
     */
    public val vpnGatewayId: Output
        get() = javaResource.vpnGatewayId().applyValue({ args0 -> args0 })
}

public object VpnGatewayMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.ec2.VpnGateway::class == javaResource::class

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy