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

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

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

package com.pulumi.awsnative.ec2.kotlin

import com.pulumi.awsnative.ec2.NatGatewayArgs.builder
import com.pulumi.awsnative.kotlin.inputs.TagArgs
import com.pulumi.awsnative.kotlin.inputs.TagArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * Specifies a network address translation (NAT) gateway in the specified subnet. You can create either a public NAT gateway or a private NAT gateway. The default is a public NAT gateway. If you create a public NAT gateway, you must specify an elastic IP address.
 *  With a NAT gateway, instances in a private subnet can connect to the internet, other AWS services, or an on-premises network using the IP address of the NAT gateway. For more information, see [NAT gateways](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html) in the *Amazon VPC User Guide*.
 *  If you add a default route (``AWS::EC2::Route`` resource) that points to a NAT gateway, specify the NAT gateway ID for the route's ``NatGatewayId`` property.
 *   When you associate an Elastic IP address or secondary Elastic IP address with a public NAT gateway, the network border group of the Elastic IP address must match the network border group of the Availability Zone (AZ) that the public NAT gateway is in. Otherwise, the NAT gateway fails to launch. You can see the network border group for the AZ by viewing the details of the subnet. Similarly, you can view the network border group for the Elastic IP address by viewing its details. For more information, see [Allocate an Elastic IP address](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-eips.html#allocate-eip) in the *Amazon VPC User Guide*.
 * @property allocationId [Public NAT gateway only] The allocation ID of the Elastic IP address that's associated with the NAT gateway. This property is required for a public NAT gateway and cannot be specified with a private NAT gateway.
 * @property connectivityType Indicates whether the NAT gateway supports public or private connectivity. The default is public connectivity.
 * @property maxDrainDurationSeconds The maximum amount of time to wait (in seconds) before forcibly releasing the IP addresses if connections are still in progress. Default value is 350 seconds.
 * @property privateIpAddress The private IPv4 address to assign to the NAT gateway. If you don't provide an address, a private IPv4 address will be automatically assigned.
 * @property secondaryAllocationIds Secondary EIP allocation IDs. For more information, see [Create a NAT gateway](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html#nat-gateway-creating) in the *Amazon VPC User Guide*.
 * @property secondaryPrivateIpAddressCount [Private NAT gateway only] The number of secondary private IPv4 addresses you want to assign to the NAT gateway. For more information about secondary addresses, see [Create a NAT gateway](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html#nat-gateway-creating) in the *Amazon Virtual Private Cloud User Guide*.
 *   ``SecondaryPrivateIpAddressCount`` and ``SecondaryPrivateIpAddresses`` cannot be set at the same time.
 * @property secondaryPrivateIpAddresses Secondary private IPv4 addresses. For more information about secondary addresses, see [Create a NAT gateway](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html#nat-gateway-creating) in the *Amazon Virtual Private Cloud User Guide*.
 *   ``SecondaryPrivateIpAddressCount`` and ``SecondaryPrivateIpAddresses`` cannot be set at the same time.
 * @property subnetId The ID of the subnet in which the NAT gateway is located.
 * @property tags The tags for the NAT gateway.
 */
public data class NatGatewayArgs(
    public val allocationId: Output? = null,
    public val connectivityType: Output? = null,
    public val maxDrainDurationSeconds: Output? = null,
    public val privateIpAddress: Output? = null,
    public val secondaryAllocationIds: Output>? = null,
    public val secondaryPrivateIpAddressCount: Output? = null,
    public val secondaryPrivateIpAddresses: Output>? = null,
    public val subnetId: Output? = null,
    public val tags: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.awsnative.ec2.NatGatewayArgs =
        com.pulumi.awsnative.ec2.NatGatewayArgs.builder()
            .allocationId(allocationId?.applyValue({ args0 -> args0 }))
            .connectivityType(connectivityType?.applyValue({ args0 -> args0 }))
            .maxDrainDurationSeconds(maxDrainDurationSeconds?.applyValue({ args0 -> args0 }))
            .privateIpAddress(privateIpAddress?.applyValue({ args0 -> args0 }))
            .secondaryAllocationIds(
                secondaryAllocationIds?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0
                    })
                }),
            )
            .secondaryPrivateIpAddressCount(secondaryPrivateIpAddressCount?.applyValue({ args0 -> args0 }))
            .secondaryPrivateIpAddresses(
                secondaryPrivateIpAddresses?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0
                    })
                }),
            )
            .subnetId(subnetId?.applyValue({ args0 -> args0 }))
            .tags(
                tags?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            ).build()
}

/**
 * Builder for [NatGatewayArgs].
 */
@PulumiTagMarker
public class NatGatewayArgsBuilder internal constructor() {
    private var allocationId: Output? = null

    private var connectivityType: Output? = null

    private var maxDrainDurationSeconds: Output? = null

    private var privateIpAddress: Output? = null

    private var secondaryAllocationIds: Output>? = null

    private var secondaryPrivateIpAddressCount: Output? = null

    private var secondaryPrivateIpAddresses: Output>? = null

    private var subnetId: Output? = null

    private var tags: Output>? = null

    /**
     * @param value [Public NAT gateway only] The allocation ID of the Elastic IP address that's associated with the NAT gateway. This property is required for a public NAT gateway and cannot be specified with a private NAT gateway.
     */
    @JvmName("cyqbsquumbuvbbgt")
    public suspend fun allocationId(`value`: Output) {
        this.allocationId = value
    }

    /**
     * @param value Indicates whether the NAT gateway supports public or private connectivity. The default is public connectivity.
     */
    @JvmName("alheylnhqxsbjhuh")
    public suspend fun connectivityType(`value`: Output) {
        this.connectivityType = value
    }

    /**
     * @param value The maximum amount of time to wait (in seconds) before forcibly releasing the IP addresses if connections are still in progress. Default value is 350 seconds.
     */
    @JvmName("mbldiidflxnahnos")
    public suspend fun maxDrainDurationSeconds(`value`: Output) {
        this.maxDrainDurationSeconds = value
    }

    /**
     * @param value The private IPv4 address to assign to the NAT gateway. If you don't provide an address, a private IPv4 address will be automatically assigned.
     */
    @JvmName("vxxshfnwqkqsmhms")
    public suspend fun privateIpAddress(`value`: Output) {
        this.privateIpAddress = value
    }

    /**
     * @param value Secondary EIP allocation IDs. For more information, see [Create a NAT gateway](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html#nat-gateway-creating) in the *Amazon VPC User Guide*.
     */
    @JvmName("xdqdhayerhhldbmv")
    public suspend fun secondaryAllocationIds(`value`: Output>) {
        this.secondaryAllocationIds = value
    }

    @JvmName("aafajjgumgokoovy")
    public suspend fun secondaryAllocationIds(vararg values: Output) {
        this.secondaryAllocationIds = Output.all(values.asList())
    }

    /**
     * @param values Secondary EIP allocation IDs. For more information, see [Create a NAT gateway](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html#nat-gateway-creating) in the *Amazon VPC User Guide*.
     */
    @JvmName("hrehpkgdjbhvypdk")
    public suspend fun secondaryAllocationIds(values: List>) {
        this.secondaryAllocationIds = Output.all(values)
    }

    /**
     * @param value [Private NAT gateway only] The number of secondary private IPv4 addresses you want to assign to the NAT gateway. For more information about secondary addresses, see [Create a NAT gateway](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html#nat-gateway-creating) in the *Amazon Virtual Private Cloud User Guide*.
     *   ``SecondaryPrivateIpAddressCount`` and ``SecondaryPrivateIpAddresses`` cannot be set at the same time.
     */
    @JvmName("pjminnwuohpvhbim")
    public suspend fun secondaryPrivateIpAddressCount(`value`: Output) {
        this.secondaryPrivateIpAddressCount = value
    }

    /**
     * @param value Secondary private IPv4 addresses. For more information about secondary addresses, see [Create a NAT gateway](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html#nat-gateway-creating) in the *Amazon Virtual Private Cloud User Guide*.
     *   ``SecondaryPrivateIpAddressCount`` and ``SecondaryPrivateIpAddresses`` cannot be set at the same time.
     */
    @JvmName("apwirvhfvixamyum")
    public suspend fun secondaryPrivateIpAddresses(`value`: Output>) {
        this.secondaryPrivateIpAddresses = value
    }

    @JvmName("ejmpwdbwhvccmnpi")
    public suspend fun secondaryPrivateIpAddresses(vararg values: Output) {
        this.secondaryPrivateIpAddresses = Output.all(values.asList())
    }

    /**
     * @param values Secondary private IPv4 addresses. For more information about secondary addresses, see [Create a NAT gateway](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html#nat-gateway-creating) in the *Amazon Virtual Private Cloud User Guide*.
     *   ``SecondaryPrivateIpAddressCount`` and ``SecondaryPrivateIpAddresses`` cannot be set at the same time.
     */
    @JvmName("kpjiqsbsqjytahgx")
    public suspend fun secondaryPrivateIpAddresses(values: List>) {
        this.secondaryPrivateIpAddresses = Output.all(values)
    }

    /**
     * @param value The ID of the subnet in which the NAT gateway is located.
     */
    @JvmName("ybqafiyihuplcdcj")
    public suspend fun subnetId(`value`: Output) {
        this.subnetId = value
    }

    /**
     * @param value The tags for the NAT gateway.
     */
    @JvmName("ojpkngisqxxdehxv")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    @JvmName("ppncveodbbbbmspg")
    public suspend fun tags(vararg values: Output) {
        this.tags = Output.all(values.asList())
    }

    /**
     * @param values The tags for the NAT gateway.
     */
    @JvmName("esfmfwwmitwnpgbo")
    public suspend fun tags(values: List>) {
        this.tags = Output.all(values)
    }

    /**
     * @param value [Public NAT gateway only] The allocation ID of the Elastic IP address that's associated with the NAT gateway. This property is required for a public NAT gateway and cannot be specified with a private NAT gateway.
     */
    @JvmName("saojqvwyvkihugox")
    public suspend fun allocationId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.allocationId = mapped
    }

    /**
     * @param value Indicates whether the NAT gateway supports public or private connectivity. The default is public connectivity.
     */
    @JvmName("ifqxfihcnpobcama")
    public suspend fun connectivityType(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.connectivityType = mapped
    }

    /**
     * @param value The maximum amount of time to wait (in seconds) before forcibly releasing the IP addresses if connections are still in progress. Default value is 350 seconds.
     */
    @JvmName("rkondjirswjbxhny")
    public suspend fun maxDrainDurationSeconds(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.maxDrainDurationSeconds = mapped
    }

    /**
     * @param value The private IPv4 address to assign to the NAT gateway. If you don't provide an address, a private IPv4 address will be automatically assigned.
     */
    @JvmName("hslssqiwgoagbxsg")
    public suspend fun privateIpAddress(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.privateIpAddress = mapped
    }

    /**
     * @param value Secondary EIP allocation IDs. For more information, see [Create a NAT gateway](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html#nat-gateway-creating) in the *Amazon VPC User Guide*.
     */
    @JvmName("bqastvaarhtiypwi")
    public suspend fun secondaryAllocationIds(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.secondaryAllocationIds = mapped
    }

    /**
     * @param values Secondary EIP allocation IDs. For more information, see [Create a NAT gateway](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html#nat-gateway-creating) in the *Amazon VPC User Guide*.
     */
    @JvmName("qqlxjmbmgilvnavu")
    public suspend fun secondaryAllocationIds(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.secondaryAllocationIds = mapped
    }

    /**
     * @param value [Private NAT gateway only] The number of secondary private IPv4 addresses you want to assign to the NAT gateway. For more information about secondary addresses, see [Create a NAT gateway](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html#nat-gateway-creating) in the *Amazon Virtual Private Cloud User Guide*.
     *   ``SecondaryPrivateIpAddressCount`` and ``SecondaryPrivateIpAddresses`` cannot be set at the same time.
     */
    @JvmName("iturfrnomcqpnwbd")
    public suspend fun secondaryPrivateIpAddressCount(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.secondaryPrivateIpAddressCount = mapped
    }

    /**
     * @param value Secondary private IPv4 addresses. For more information about secondary addresses, see [Create a NAT gateway](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html#nat-gateway-creating) in the *Amazon Virtual Private Cloud User Guide*.
     *   ``SecondaryPrivateIpAddressCount`` and ``SecondaryPrivateIpAddresses`` cannot be set at the same time.
     */
    @JvmName("ocfpxbrjtyybxstc")
    public suspend fun secondaryPrivateIpAddresses(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.secondaryPrivateIpAddresses = mapped
    }

    /**
     * @param values Secondary private IPv4 addresses. For more information about secondary addresses, see [Create a NAT gateway](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html#nat-gateway-creating) in the *Amazon Virtual Private Cloud User Guide*.
     *   ``SecondaryPrivateIpAddressCount`` and ``SecondaryPrivateIpAddresses`` cannot be set at the same time.
     */
    @JvmName("lwipsjylnvqqbmge")
    public suspend fun secondaryPrivateIpAddresses(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.secondaryPrivateIpAddresses = mapped
    }

    /**
     * @param value The ID of the subnet in which the NAT gateway is located.
     */
    @JvmName("axwerphyahlfntce")
    public suspend fun subnetId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.subnetId = mapped
    }

    /**
     * @param value The tags for the NAT gateway.
     */
    @JvmName("aurngfrydeyfjmnd")
    public suspend fun tags(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param argument The tags for the NAT gateway.
     */
    @JvmName("rxtwdbpysrpjvgkp")
    public suspend fun tags(argument: List Unit>) {
        val toBeMapped = argument.toList().map { TagArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.tags = mapped
    }

    /**
     * @param argument The tags for the NAT gateway.
     */
    @JvmName("ylhiljaulvxhjygq")
    public suspend fun tags(vararg argument: suspend TagArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map { TagArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.tags = mapped
    }

    /**
     * @param argument The tags for the NAT gateway.
     */
    @JvmName("vjwcpjorvjycmsjt")
    public suspend fun tags(argument: suspend TagArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(TagArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.tags = mapped
    }

    /**
     * @param values The tags for the NAT gateway.
     */
    @JvmName("labrsbcvdusshcgk")
    public suspend fun tags(vararg values: TagArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    internal fun build(): NatGatewayArgs = NatGatewayArgs(
        allocationId = allocationId,
        connectivityType = connectivityType,
        maxDrainDurationSeconds = maxDrainDurationSeconds,
        privateIpAddress = privateIpAddress,
        secondaryAllocationIds = secondaryAllocationIds,
        secondaryPrivateIpAddressCount = secondaryPrivateIpAddressCount,
        secondaryPrivateIpAddresses = secondaryPrivateIpAddresses,
        subnetId = subnetId,
        tags = tags,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy