Class NatGatewayProps.Builder
java.lang.Object
software.amazon.awscdk.services.ec2.alpha.NatGatewayProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<NatGatewayProps>
- Enclosing interface:
NatGatewayProps
@Stability(Experimental)
public static final class NatGatewayProps.Builder
extends Object
implements software.amazon.jsii.Builder<NatGatewayProps>
A builder for
NatGatewayProps-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionallocationId(String allocationId) Sets the value ofNatGatewayOptions.getAllocationId()build()Builds the configured instance.connectivityType(NatConnectivityType connectivityType) Sets the value ofNatGatewayOptions.getConnectivityType()maxDrainDuration(Duration maxDrainDuration) Sets the value ofNatGatewayOptions.getMaxDrainDuration()natGatewayName(String natGatewayName) Sets the value ofNatGatewayOptions.getNatGatewayName()privateIpAddress(String privateIpAddress) Sets the value ofNatGatewayOptions.getPrivateIpAddress()secondaryAllocationIds(List<String> secondaryAllocationIds) Sets the value ofNatGatewayOptions.getSecondaryAllocationIds()secondaryPrivateIpAddressCount(Number secondaryPrivateIpAddressCount) Sets the value ofNatGatewayOptions.getSecondaryPrivateIpAddressCount()secondaryPrivateIpAddresses(List<String> secondaryPrivateIpAddresses) Sets the value ofNatGatewayOptions.getSecondaryPrivateIpAddresses()Sets the value ofNatGatewayOptions.getSubnet()Sets the value ofNatGatewayProps.getVpc()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
vpc
Sets the value ofNatGatewayProps.getVpc()- Parameters:
vpc- The ID of the VPC in which the NAT gateway is located.- Returns:
this
-
subnet
Sets the value ofNatGatewayOptions.getSubnet()- Parameters:
subnet- The subnet in which the NAT gateway is located. This parameter is required.- Returns:
this
-
allocationId
Sets the value ofNatGatewayOptions.getAllocationId()- Parameters:
allocationId- AllocationID of 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
@Stability(Experimental) public NatGatewayProps.Builder connectivityType(NatConnectivityType connectivityType) Sets the value ofNatGatewayOptions.getConnectivityType()- Parameters:
connectivityType- Indicates whether the NAT gateway supports public or private connectivity.- Returns:
this
-
maxDrainDuration
Sets the value ofNatGatewayOptions.getMaxDrainDuration()- Parameters:
maxDrainDuration- The maximum amount of time to wait before forcibly releasing the IP addresses if connections are still in progress.- Returns:
this
-
natGatewayName
Sets the value ofNatGatewayOptions.getNatGatewayName()- Parameters:
natGatewayName- The resource name of the NAT gateway.- Returns:
this
-
privateIpAddress
Sets the value ofNatGatewayOptions.getPrivateIpAddress()- Parameters:
privateIpAddress- The private IPv4 address to assign to the NAT gateway.- Returns:
this
-
secondaryAllocationIds
@Stability(Experimental) public NatGatewayProps.Builder secondaryAllocationIds(List<String> secondaryAllocationIds) Sets the value ofNatGatewayOptions.getSecondaryAllocationIds()- Parameters:
secondaryAllocationIds- Secondary EIP allocation IDs.- Returns:
this
-
secondaryPrivateIpAddressCount
@Stability(Experimental) public NatGatewayProps.Builder secondaryPrivateIpAddressCount(Number secondaryPrivateIpAddressCount) Sets the value ofNatGatewayOptions.getSecondaryPrivateIpAddressCount()- Parameters:
secondaryPrivateIpAddressCount- The number of secondary private IPv4 addresses you want to assign to the NAT gateway.SecondaryPrivateIpAddressCountandSecondaryPrivateIpAddressescannot be set at the same time.- Returns:
this
-
secondaryPrivateIpAddresses
@Stability(Experimental) public NatGatewayProps.Builder secondaryPrivateIpAddresses(List<String> secondaryPrivateIpAddresses) Sets the value ofNatGatewayOptions.getSecondaryPrivateIpAddresses()- Parameters:
secondaryPrivateIpAddresses- Secondary private IPv4 addresses.SecondaryPrivateIpAddressCountandSecondaryPrivateIpAddressescannot be set at the same time.- Returns:
this
-
build
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<NatGatewayProps>- Returns:
- a new instance of
NatGatewayProps - Throws:
NullPointerException- if any required attribute was not provided
-