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

com.pulumi.awsnative.ec2.kotlin.CustomerGateway.kt Maven / Gradle / Ivy

@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.Double
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List

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

    public var args: CustomerGatewayArgs = CustomerGatewayArgs()

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

/**
 * Specifies a customer gateway.
 */
public class CustomerGateway internal constructor(
    override val javaResource: com.pulumi.awsnative.ec2.CustomerGateway,
) : KotlinCustomResource(javaResource, CustomerGatewayMapper) {
    /**
     * For customer gateway devices that support BGP, specify the device's ASN. You must specify either ``BgpAsn`` or ``BgpAsnExtended`` when creating the customer gateway. If the ASN is larger than ``2,147,483,647``, you must use ``BgpAsnExtended``.
     *  Default: 65000
     *  Valid values: ``1`` to ``2,147,483,647``
     */
    public val bgpAsn: Output?
        get() = javaResource.bgpAsn().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * For customer gateway devices that support BGP, specify the device's ASN. You must specify either ``BgpAsn`` or ``BgpAsnExtended`` when creating the customer gateway. If the ASN is larger than ``2,147,483,647``, you must use ``BgpAsnExtended``.
     *  Valid values: ``2,147,483,648`` to ``4,294,967,295``
     */
    public val bgpAsnExtended: Output?
        get() = javaResource.bgpAsnExtended().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The Amazon Resource Name (ARN) for the customer gateway certificate.
     */
    public val certificateArn: Output?
        get() = javaResource.certificateArn().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

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

    /**
     * The name of customer gateway device.
     */
    public val deviceName: Output?
        get() = javaResource.deviceName().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * IPv4 address for the customer gateway device's outside interface. The address must be static. If ``OutsideIpAddressType`` in your VPN connection options is set to ``PrivateIpv4``, you can use an RFC6598 or RFC1918 private IPv4 address. If ``OutsideIpAddressType`` is set to ``PublicIpv4``, you can use a public IPv4 address.
     */
    public val ipAddress: Output
        get() = javaResource.ipAddress().applyValue({ args0 -> args0 })

    /**
     * One or more tags for the customer 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 that this customer gateway supports (``ipsec.1``).
     */
    public val type: Output
        get() = javaResource.type().applyValue({ args0 -> args0 })
}

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

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy