Class CfnNatGatewayProps.Builder
java.lang.Object
software.amazon.awscdk.services.ec2.CfnNatGatewayProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnNatGatewayProps>
- Enclosing interface:
- CfnNatGatewayProps
@Stability(Stable)
public static final class CfnNatGatewayProps.Builder
extends Object
implements software.amazon.jsii.Builder<CfnNatGatewayProps>
A builder for
CfnNatGatewayProps-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionallocationId(String allocationId) Sets the value ofCfnNatGatewayProps.getAllocationId()build()Builds the configured instance.connectivityType(String connectivityType) Sets the value ofCfnNatGatewayProps.getConnectivityType()maxDrainDurationSeconds(Number maxDrainDurationSeconds) Sets the value ofCfnNatGatewayProps.getMaxDrainDurationSeconds()privateIpAddress(String privateIpAddress) Sets the value ofCfnNatGatewayProps.getPrivateIpAddress()secondaryAllocationIds(List<String> secondaryAllocationIds) Sets the value ofCfnNatGatewayProps.getSecondaryAllocationIds()secondaryPrivateIpAddressCount(Number secondaryPrivateIpAddressCount) Sets the value ofCfnNatGatewayProps.getSecondaryPrivateIpAddressCount()secondaryPrivateIpAddresses(List<String> secondaryPrivateIpAddresses) Sets the value ofCfnNatGatewayProps.getSecondaryPrivateIpAddresses()Sets the value ofCfnNatGatewayProps.getSubnetId()Sets the value ofCfnNatGatewayProps.getTags()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
subnetId
Sets the value ofCfnNatGatewayProps.getSubnetId()- Parameters:
subnetId- The ID of the subnet in which the NAT gateway is located. This parameter is required.- Returns:
this
-
allocationId
Sets the value ofCfnNatGatewayProps.getAllocationId()- Parameters:
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.- Returns:
this
-
connectivityType
Sets the value ofCfnNatGatewayProps.getConnectivityType()- Parameters:
connectivityType- Indicates whether the NAT gateway supports public or private connectivity. The default is public connectivity.- Returns:
this
-
maxDrainDurationSeconds
@Stability(Stable) public CfnNatGatewayProps.Builder maxDrainDurationSeconds(Number maxDrainDurationSeconds) Sets the value ofCfnNatGatewayProps.getMaxDrainDurationSeconds()- Parameters:
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.- Returns:
this
-
privateIpAddress
Sets the value ofCfnNatGatewayProps.getPrivateIpAddress()- Parameters:
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.- Returns:
this
-
secondaryAllocationIds
@Stability(Stable) public CfnNatGatewayProps.Builder secondaryAllocationIds(List<String> secondaryAllocationIds) Sets the value ofCfnNatGatewayProps.getSecondaryAllocationIds()- Parameters:
secondaryAllocationIds- Secondary EIP allocation IDs. For more information, see Create a NAT gateway in the Amazon VPC User Guide .- Returns:
this
-
secondaryPrivateIpAddressCount
@Stability(Stable) public CfnNatGatewayProps.Builder secondaryPrivateIpAddressCount(Number secondaryPrivateIpAddressCount) Sets the value ofCfnNatGatewayProps.getSecondaryPrivateIpAddressCount()- Parameters:
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 in the Amazon Virtual Private Cloud User Guide .SecondaryPrivateIpAddressCountandSecondaryPrivateIpAddressescannot be set at the same time.- Returns:
this
-
secondaryPrivateIpAddresses
@Stability(Stable) public CfnNatGatewayProps.Builder secondaryPrivateIpAddresses(List<String> secondaryPrivateIpAddresses) Sets the value ofCfnNatGatewayProps.getSecondaryPrivateIpAddresses()- Parameters:
secondaryPrivateIpAddresses- Secondary private IPv4 addresses. For more information about secondary addresses, see Create a NAT gateway in the Amazon Virtual Private Cloud User Guide .SecondaryPrivateIpAddressCountandSecondaryPrivateIpAddressescannot be set at the same time.- Returns:
this
-
tags
Sets the value ofCfnNatGatewayProps.getTags()- Parameters:
tags- The tags for the NAT gateway.- Returns:
this
-
build
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<CfnNatGatewayProps>- Returns:
- a new instance of
CfnNatGatewayProps - Throws:
NullPointerException- if any required attribute was not provided
-