![JAR search and dependency download from the Maven repository](/logo.png)
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
© 2015 - 2025 Weber Informatics LLC | Privacy Policy