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

software.amazon.awscdk.services.ec2.alpha.NatGatewayOptions Maven / Gradle / Ivy

There is a newer version: 2.167.2-alpha.0
Show newest version
package software.amazon.awscdk.services.ec2.alpha;

/**
 * (experimental) Options to define a NAT gateway.
 * 

* Example: *

*

 * Stack stack = new Stack();
 * VpcV2 myVpc = new VpcV2(this, "Vpc");
 * RouteTable routeTable = RouteTable.Builder.create(this, "RouteTable")
 *         .vpc(myVpc)
 *         .build();
 * SubnetV2 subnet = SubnetV2.Builder.create(this, "Subnet")
 *         .vpc(myVpc)
 *         .availabilityZone("eu-west-2a")
 *         .ipv4CidrBlock(new IpCidr("10.0.0.0/24"))
 *         .subnetType(SubnetType.PUBLIC)
 *         .build();
 * myVpc.addInternetGateway();
 * myVpc.addNatGateway(NatGatewayOptions.builder()
 *         .subnet(subnet)
 *         .connectivityType(NatConnectivityType.PUBLIC)
 *         .build());
 * 
*/ @javax.annotation.Generated(value = "jsii-pacmak/1.103.1 (build bef2dea)", date = "2024-10-11T15:56:07.921Z") @software.amazon.jsii.Jsii(module = software.amazon.awscdk.services.ec2.alpha.$Module.class, fqn = "@aws-cdk/aws-ec2-alpha.NatGatewayOptions") @software.amazon.jsii.Jsii.Proxy(NatGatewayOptions.Jsii$Proxy.class) @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public interface NatGatewayOptions extends software.amazon.jsii.JsiiSerializable { /** * (experimental) The subnet in which the NAT gateway is located. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.ec2.alpha.ISubnetV2 getSubnet(); /** * (experimental) 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. *

* Default: - attr.allocationID of a new Elastic IP created by default * //TODO: ADD L2 for elastic ip */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) default @org.jetbrains.annotations.Nullable java.lang.String getAllocationId() { return null; } /** * (experimental) Indicates whether the NAT gateway supports public or private connectivity. *

* Default: NatConnectivityType.Public */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.ec2.alpha.NatConnectivityType getConnectivityType() { return null; } /** * (experimental) The maximum amount of time to wait before forcibly releasing the IP addresses if connections are still in progress. *

* Default: 350seconds */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) default @org.jetbrains.annotations.Nullable software.amazon.awscdk.Duration getMaxDrainDuration() { return null; } /** * (experimental) The resource name of the NAT gateway. *

* Default: - NATGW provisioned without any name */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) default @org.jetbrains.annotations.Nullable java.lang.String getNatGatewayName() { return null; } /** * (experimental) The private IPv4 address to assign to the NAT gateway. *

* Default: - If you don't provide an address, a private IPv4 address will be automatically assigned. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) default @org.jetbrains.annotations.Nullable java.lang.String getPrivateIpAddress() { return null; } /** * (experimental) Secondary EIP allocation IDs. *

* Default: - no secondary allocation IDs attached to NATGW *

* @see https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html#nat-gateway-creating */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) default @org.jetbrains.annotations.Nullable java.util.List getSecondaryAllocationIds() { return null; } /** * (experimental) The number of secondary private IPv4 addresses you want to assign to the NAT gateway. *

* SecondaryPrivateIpAddressCount and SecondaryPrivateIpAddresses cannot be * set at the same time. *

* Default: - no secondary allocation IDs associated with NATGW *

* @see https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html#nat-gateway-creating */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) default @org.jetbrains.annotations.Nullable java.lang.Number getSecondaryPrivateIpAddressCount() { return null; } /** * (experimental) Secondary private IPv4 addresses. *

* SecondaryPrivateIpAddressCount and SecondaryPrivateIpAddresses cannot be * set at the same time. *

* Default: - no secondary private IpAddresses associated with NATGW *

* @see https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html#nat-gateway-creating */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) default @org.jetbrains.annotations.Nullable java.util.List getSecondaryPrivateIpAddresses() { return null; } /** * @return a {@link Builder} of {@link NatGatewayOptions} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) static Builder builder() { return new Builder(); } /** * A builder for {@link NatGatewayOptions} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public static final class Builder implements software.amazon.jsii.Builder { software.amazon.awscdk.services.ec2.alpha.ISubnetV2 subnet; java.lang.String allocationId; software.amazon.awscdk.services.ec2.alpha.NatConnectivityType connectivityType; software.amazon.awscdk.Duration maxDrainDuration; java.lang.String natGatewayName; java.lang.String privateIpAddress; java.util.List secondaryAllocationIds; java.lang.Number secondaryPrivateIpAddressCount; java.util.List secondaryPrivateIpAddresses; /** * Sets the value of {@link NatGatewayOptions#getSubnet} * @param subnet The subnet in which the NAT gateway is located. This parameter is required. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder subnet(software.amazon.awscdk.services.ec2.alpha.ISubnetV2 subnet) { this.subnet = subnet; return this; } /** * Sets the value of {@link NatGatewayOptions#getAllocationId} * @param 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. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder allocationId(java.lang.String allocationId) { this.allocationId = allocationId; return this; } /** * Sets the value of {@link NatGatewayOptions#getConnectivityType} * @param connectivityType Indicates whether the NAT gateway supports public or private connectivity. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder connectivityType(software.amazon.awscdk.services.ec2.alpha.NatConnectivityType connectivityType) { this.connectivityType = connectivityType; return this; } /** * Sets the value of {@link NatGatewayOptions#getMaxDrainDuration} * @param maxDrainDuration The maximum amount of time to wait before forcibly releasing the IP addresses if connections are still in progress. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder maxDrainDuration(software.amazon.awscdk.Duration maxDrainDuration) { this.maxDrainDuration = maxDrainDuration; return this; } /** * Sets the value of {@link NatGatewayOptions#getNatGatewayName} * @param natGatewayName The resource name of the NAT gateway. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder natGatewayName(java.lang.String natGatewayName) { this.natGatewayName = natGatewayName; return this; } /** * Sets the value of {@link NatGatewayOptions#getPrivateIpAddress} * @param privateIpAddress The private IPv4 address to assign to the NAT gateway. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder privateIpAddress(java.lang.String privateIpAddress) { this.privateIpAddress = privateIpAddress; return this; } /** * Sets the value of {@link NatGatewayOptions#getSecondaryAllocationIds} * @param secondaryAllocationIds Secondary EIP allocation IDs. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder secondaryAllocationIds(java.util.List secondaryAllocationIds) { this.secondaryAllocationIds = secondaryAllocationIds; return this; } /** * Sets the value of {@link NatGatewayOptions#getSecondaryPrivateIpAddressCount} * @param secondaryPrivateIpAddressCount The number of secondary private IPv4 addresses you want to assign to the NAT gateway. * SecondaryPrivateIpAddressCount and SecondaryPrivateIpAddresses cannot be * set at the same time. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder secondaryPrivateIpAddressCount(java.lang.Number secondaryPrivateIpAddressCount) { this.secondaryPrivateIpAddressCount = secondaryPrivateIpAddressCount; return this; } /** * Sets the value of {@link NatGatewayOptions#getSecondaryPrivateIpAddresses} * @param secondaryPrivateIpAddresses Secondary private IPv4 addresses. * SecondaryPrivateIpAddressCount and SecondaryPrivateIpAddresses cannot be * set at the same time. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder secondaryPrivateIpAddresses(java.util.List secondaryPrivateIpAddresses) { this.secondaryPrivateIpAddresses = secondaryPrivateIpAddresses; return this; } /** * Builds the configured instance. * @return a new instance of {@link NatGatewayOptions} * @throws NullPointerException if any required attribute was not provided */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) @Override public NatGatewayOptions build() { return new Jsii$Proxy(this); } } /** * An implementation for {@link NatGatewayOptions} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) @software.amazon.jsii.Internal final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements NatGatewayOptions { private final software.amazon.awscdk.services.ec2.alpha.ISubnetV2 subnet; private final java.lang.String allocationId; private final software.amazon.awscdk.services.ec2.alpha.NatConnectivityType connectivityType; private final software.amazon.awscdk.Duration maxDrainDuration; private final java.lang.String natGatewayName; private final java.lang.String privateIpAddress; private final java.util.List secondaryAllocationIds; private final java.lang.Number secondaryPrivateIpAddressCount; private final java.util.List secondaryPrivateIpAddresses; /** * Constructor that initializes the object based on values retrieved from the JsiiObject. * @param objRef Reference to the JSII managed object. */ protected Jsii$Proxy(final software.amazon.jsii.JsiiObjectRef objRef) { super(objRef); this.subnet = software.amazon.jsii.Kernel.get(this, "subnet", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.ec2.alpha.ISubnetV2.class)); this.allocationId = software.amazon.jsii.Kernel.get(this, "allocationId", software.amazon.jsii.NativeType.forClass(java.lang.String.class)); this.connectivityType = software.amazon.jsii.Kernel.get(this, "connectivityType", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.ec2.alpha.NatConnectivityType.class)); this.maxDrainDuration = software.amazon.jsii.Kernel.get(this, "maxDrainDuration", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.Duration.class)); this.natGatewayName = software.amazon.jsii.Kernel.get(this, "natGatewayName", software.amazon.jsii.NativeType.forClass(java.lang.String.class)); this.privateIpAddress = software.amazon.jsii.Kernel.get(this, "privateIpAddress", software.amazon.jsii.NativeType.forClass(java.lang.String.class)); this.secondaryAllocationIds = software.amazon.jsii.Kernel.get(this, "secondaryAllocationIds", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(java.lang.String.class))); this.secondaryPrivateIpAddressCount = software.amazon.jsii.Kernel.get(this, "secondaryPrivateIpAddressCount", software.amazon.jsii.NativeType.forClass(java.lang.Number.class)); this.secondaryPrivateIpAddresses = software.amazon.jsii.Kernel.get(this, "secondaryPrivateIpAddresses", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(java.lang.String.class))); } /** * Constructor that initializes the object based on literal property values passed by the {@link Builder}. */ protected Jsii$Proxy(final Builder builder) { super(software.amazon.jsii.JsiiObject.InitializationMode.JSII); this.subnet = java.util.Objects.requireNonNull(builder.subnet, "subnet is required"); this.allocationId = builder.allocationId; this.connectivityType = builder.connectivityType; this.maxDrainDuration = builder.maxDrainDuration; this.natGatewayName = builder.natGatewayName; this.privateIpAddress = builder.privateIpAddress; this.secondaryAllocationIds = builder.secondaryAllocationIds; this.secondaryPrivateIpAddressCount = builder.secondaryPrivateIpAddressCount; this.secondaryPrivateIpAddresses = builder.secondaryPrivateIpAddresses; } @Override public final software.amazon.awscdk.services.ec2.alpha.ISubnetV2 getSubnet() { return this.subnet; } @Override public final java.lang.String getAllocationId() { return this.allocationId; } @Override public final software.amazon.awscdk.services.ec2.alpha.NatConnectivityType getConnectivityType() { return this.connectivityType; } @Override public final software.amazon.awscdk.Duration getMaxDrainDuration() { return this.maxDrainDuration; } @Override public final java.lang.String getNatGatewayName() { return this.natGatewayName; } @Override public final java.lang.String getPrivateIpAddress() { return this.privateIpAddress; } @Override public final java.util.List getSecondaryAllocationIds() { return this.secondaryAllocationIds; } @Override public final java.lang.Number getSecondaryPrivateIpAddressCount() { return this.secondaryPrivateIpAddressCount; } @Override public final java.util.List getSecondaryPrivateIpAddresses() { return this.secondaryPrivateIpAddresses; } @Override @software.amazon.jsii.Internal public com.fasterxml.jackson.databind.JsonNode $jsii$toJson() { final com.fasterxml.jackson.databind.ObjectMapper om = software.amazon.jsii.JsiiObjectMapper.INSTANCE; final com.fasterxml.jackson.databind.node.ObjectNode data = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode(); data.set("subnet", om.valueToTree(this.getSubnet())); if (this.getAllocationId() != null) { data.set("allocationId", om.valueToTree(this.getAllocationId())); } if (this.getConnectivityType() != null) { data.set("connectivityType", om.valueToTree(this.getConnectivityType())); } if (this.getMaxDrainDuration() != null) { data.set("maxDrainDuration", om.valueToTree(this.getMaxDrainDuration())); } if (this.getNatGatewayName() != null) { data.set("natGatewayName", om.valueToTree(this.getNatGatewayName())); } if (this.getPrivateIpAddress() != null) { data.set("privateIpAddress", om.valueToTree(this.getPrivateIpAddress())); } if (this.getSecondaryAllocationIds() != null) { data.set("secondaryAllocationIds", om.valueToTree(this.getSecondaryAllocationIds())); } if (this.getSecondaryPrivateIpAddressCount() != null) { data.set("secondaryPrivateIpAddressCount", om.valueToTree(this.getSecondaryPrivateIpAddressCount())); } if (this.getSecondaryPrivateIpAddresses() != null) { data.set("secondaryPrivateIpAddresses", om.valueToTree(this.getSecondaryPrivateIpAddresses())); } final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode(); struct.set("fqn", om.valueToTree("@aws-cdk/aws-ec2-alpha.NatGatewayOptions")); struct.set("data", data); final com.fasterxml.jackson.databind.node.ObjectNode obj = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode(); obj.set("$jsii.struct", struct); return obj; } @Override public final boolean equals(final Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; NatGatewayOptions.Jsii$Proxy that = (NatGatewayOptions.Jsii$Proxy) o; if (!subnet.equals(that.subnet)) return false; if (this.allocationId != null ? !this.allocationId.equals(that.allocationId) : that.allocationId != null) return false; if (this.connectivityType != null ? !this.connectivityType.equals(that.connectivityType) : that.connectivityType != null) return false; if (this.maxDrainDuration != null ? !this.maxDrainDuration.equals(that.maxDrainDuration) : that.maxDrainDuration != null) return false; if (this.natGatewayName != null ? !this.natGatewayName.equals(that.natGatewayName) : that.natGatewayName != null) return false; if (this.privateIpAddress != null ? !this.privateIpAddress.equals(that.privateIpAddress) : that.privateIpAddress != null) return false; if (this.secondaryAllocationIds != null ? !this.secondaryAllocationIds.equals(that.secondaryAllocationIds) : that.secondaryAllocationIds != null) return false; if (this.secondaryPrivateIpAddressCount != null ? !this.secondaryPrivateIpAddressCount.equals(that.secondaryPrivateIpAddressCount) : that.secondaryPrivateIpAddressCount != null) return false; return this.secondaryPrivateIpAddresses != null ? this.secondaryPrivateIpAddresses.equals(that.secondaryPrivateIpAddresses) : that.secondaryPrivateIpAddresses == null; } @Override public final int hashCode() { int result = this.subnet.hashCode(); result = 31 * result + (this.allocationId != null ? this.allocationId.hashCode() : 0); result = 31 * result + (this.connectivityType != null ? this.connectivityType.hashCode() : 0); result = 31 * result + (this.maxDrainDuration != null ? this.maxDrainDuration.hashCode() : 0); result = 31 * result + (this.natGatewayName != null ? this.natGatewayName.hashCode() : 0); result = 31 * result + (this.privateIpAddress != null ? this.privateIpAddress.hashCode() : 0); result = 31 * result + (this.secondaryAllocationIds != null ? this.secondaryAllocationIds.hashCode() : 0); result = 31 * result + (this.secondaryPrivateIpAddressCount != null ? this.secondaryPrivateIpAddressCount.hashCode() : 0); result = 31 * result + (this.secondaryPrivateIpAddresses != null ? this.secondaryPrivateIpAddresses.hashCode() : 0); return result; } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy