/*
* Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.ec2.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
import com.amazonaws.Request;
import com.amazonaws.services.ec2.model.transform.CreateSubnetRequestMarshaller;
/**
*
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CreateSubnetRequest extends AmazonWebServiceRequest implements Serializable, Cloneable, DryRunSupportedRequest
* The tags to assign to the subnet.
*
* The Availability Zone or Local Zone for the subnet.
*
* Default: Amazon Web Services selects one for you. If you create more than one subnet in your VPC, we do not
* necessarily select a different zone for each subnet.
*
* To create a subnet in a Local Zone, set this value to the Local Zone ID, for example
*
* To create a subnet in an Outpost, set this value to the Availability Zone for the Outpost and specify the Outpost
* ARN.
*
* The AZ ID or the Local Zone ID of the subnet.
*
* The IPv4 network range for the subnet, in CIDR notation. For example,
* This parameter is not supported for an IPv6 only subnet.
*
* The IPv6 network range for the subnet, in CIDR notation. The subnet size must use a /64 prefix length.
*
* This parameter is required for an IPv6 only subnet.
*
* The Amazon Resource Name (ARN) of the Outpost. If you specify an Outpost ARN, you must also specify the
* Availability Zone of the Outpost subnet.
*
* The ID of the VPC.
*
* Indicates whether to create an IPv6 only subnet.
* us-west-2-lax-1a
. For information about the Regions that support Local Zones, see Local Zones locations.
* 10.0.0.0/24
. We modify the
* specified CIDR block to its canonical form; for example, if you specify 100.68.0.18/18
, we modify it
* to 100.68.0.0/18
.
* 10.0.0.0/24
. We modify
* the specified CIDR block to its canonical form; for example, if you specify 100.68.0.18/18
,
* we modify it to 100.68.0.0/18
.
* This parameter is not supported for an IPv6 only subnet. */ public CreateSubnetRequest(String vpcId, String cidrBlock) { setVpcId(vpcId); setCidrBlock(cidrBlock); } /** *
* The tags to assign to the subnet. *
* * @return The tags to assign to the subnet. */ public java.util.List* The tags to assign to the subnet. *
* * @param tagSpecifications * The tags to assign to the subnet. */ public void setTagSpecifications(java.util.Collection* The tags to assign to the subnet. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setTagSpecifications(java.util.Collection)} or {@link #withTagSpecifications(java.util.Collection)} if * you want to override the existing values. *
* * @param tagSpecifications * The tags to assign to the subnet. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateSubnetRequest withTagSpecifications(TagSpecification... tagSpecifications) { if (this.tagSpecifications == null) { setTagSpecifications(new com.amazonaws.internal.SdkInternalList* The tags to assign to the subnet. *
* * @param tagSpecifications * The tags to assign to the subnet. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateSubnetRequest withTagSpecifications(java.util.Collection* The Availability Zone or Local Zone for the subnet. *
** Default: Amazon Web Services selects one for you. If you create more than one subnet in your VPC, we do not * necessarily select a different zone for each subnet. *
*
* To create a subnet in a Local Zone, set this value to the Local Zone ID, for example
* us-west-2-lax-1a
. For information about the Regions that support Local Zones, see Local Zones locations.
*
* To create a subnet in an Outpost, set this value to the Availability Zone for the Outpost and specify the Outpost * ARN. *
* * @param availabilityZone * The Availability Zone or Local Zone for the subnet. ** Default: Amazon Web Services selects one for you. If you create more than one subnet in your VPC, we do * not necessarily select a different zone for each subnet. *
*
* To create a subnet in a Local Zone, set this value to the Local Zone ID, for example
* us-west-2-lax-1a
. For information about the Regions that support Local Zones, see Local Zones
* locations.
*
* To create a subnet in an Outpost, set this value to the Availability Zone for the Outpost and specify the * Outpost ARN. */ public void setAvailabilityZone(String availabilityZone) { this.availabilityZone = availabilityZone; } /** *
* The Availability Zone or Local Zone for the subnet. *
** Default: Amazon Web Services selects one for you. If you create more than one subnet in your VPC, we do not * necessarily select a different zone for each subnet. *
*
* To create a subnet in a Local Zone, set this value to the Local Zone ID, for example
* us-west-2-lax-1a
. For information about the Regions that support Local Zones, see Local Zones locations.
*
* To create a subnet in an Outpost, set this value to the Availability Zone for the Outpost and specify the Outpost * ARN. *
* * @return The Availability Zone or Local Zone for the subnet. ** Default: Amazon Web Services selects one for you. If you create more than one subnet in your VPC, we do * not necessarily select a different zone for each subnet. *
*
* To create a subnet in a Local Zone, set this value to the Local Zone ID, for example
* us-west-2-lax-1a
. For information about the Regions that support Local Zones, see Local Zones
* locations.
*
* To create a subnet in an Outpost, set this value to the Availability Zone for the Outpost and specify the * Outpost ARN. */ public String getAvailabilityZone() { return this.availabilityZone; } /** *
* The Availability Zone or Local Zone for the subnet. *
** Default: Amazon Web Services selects one for you. If you create more than one subnet in your VPC, we do not * necessarily select a different zone for each subnet. *
*
* To create a subnet in a Local Zone, set this value to the Local Zone ID, for example
* us-west-2-lax-1a
. For information about the Regions that support Local Zones, see Local Zones locations.
*
* To create a subnet in an Outpost, set this value to the Availability Zone for the Outpost and specify the Outpost * ARN. *
* * @param availabilityZone * The Availability Zone or Local Zone for the subnet. ** Default: Amazon Web Services selects one for you. If you create more than one subnet in your VPC, we do * not necessarily select a different zone for each subnet. *
*
* To create a subnet in a Local Zone, set this value to the Local Zone ID, for example
* us-west-2-lax-1a
. For information about the Regions that support Local Zones, see Local Zones
* locations.
*
* To create a subnet in an Outpost, set this value to the Availability Zone for the Outpost and specify the * Outpost ARN. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateSubnetRequest withAvailabilityZone(String availabilityZone) { setAvailabilityZone(availabilityZone); return this; } /** *
* The AZ ID or the Local Zone ID of the subnet. *
* * @param availabilityZoneId * The AZ ID or the Local Zone ID of the subnet. */ public void setAvailabilityZoneId(String availabilityZoneId) { this.availabilityZoneId = availabilityZoneId; } /** ** The AZ ID or the Local Zone ID of the subnet. *
* * @return The AZ ID or the Local Zone ID of the subnet. */ public String getAvailabilityZoneId() { return this.availabilityZoneId; } /** ** The AZ ID or the Local Zone ID of the subnet. *
* * @param availabilityZoneId * The AZ ID or the Local Zone ID of the subnet. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateSubnetRequest withAvailabilityZoneId(String availabilityZoneId) { setAvailabilityZoneId(availabilityZoneId); return this; } /** *
* The IPv4 network range for the subnet, in CIDR notation. For example, 10.0.0.0/24
. We modify the
* specified CIDR block to its canonical form; for example, if you specify 100.68.0.18/18
, we modify it
* to 100.68.0.0/18
.
*
* This parameter is not supported for an IPv6 only subnet. *
* * @param cidrBlock * The IPv4 network range for the subnet, in CIDR notation. For example,10.0.0.0/24
. We modify
* the specified CIDR block to its canonical form; for example, if you specify 100.68.0.18/18
,
* we modify it to 100.68.0.0/18
.
* * This parameter is not supported for an IPv6 only subnet. */ public void setCidrBlock(String cidrBlock) { this.cidrBlock = cidrBlock; } /** *
* The IPv4 network range for the subnet, in CIDR notation. For example, 10.0.0.0/24
. We modify the
* specified CIDR block to its canonical form; for example, if you specify 100.68.0.18/18
, we modify it
* to 100.68.0.0/18
.
*
* This parameter is not supported for an IPv6 only subnet. *
* * @return The IPv4 network range for the subnet, in CIDR notation. For example,10.0.0.0/24
. We modify
* the specified CIDR block to its canonical form; for example, if you specify 100.68.0.18/18
,
* we modify it to 100.68.0.0/18
.
* * This parameter is not supported for an IPv6 only subnet. */ public String getCidrBlock() { return this.cidrBlock; } /** *
* The IPv4 network range for the subnet, in CIDR notation. For example, 10.0.0.0/24
. We modify the
* specified CIDR block to its canonical form; for example, if you specify 100.68.0.18/18
, we modify it
* to 100.68.0.0/18
.
*
* This parameter is not supported for an IPv6 only subnet. *
* * @param cidrBlock * The IPv4 network range for the subnet, in CIDR notation. For example,10.0.0.0/24
. We modify
* the specified CIDR block to its canonical form; for example, if you specify 100.68.0.18/18
,
* we modify it to 100.68.0.0/18
.
* * This parameter is not supported for an IPv6 only subnet. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateSubnetRequest withCidrBlock(String cidrBlock) { setCidrBlock(cidrBlock); return this; } /** *
* The IPv6 network range for the subnet, in CIDR notation. The subnet size must use a /64 prefix length. *
** This parameter is required for an IPv6 only subnet. *
* * @param ipv6CidrBlock * The IPv6 network range for the subnet, in CIDR notation. The subnet size must use a /64 prefix length. ** This parameter is required for an IPv6 only subnet. */ public void setIpv6CidrBlock(String ipv6CidrBlock) { this.ipv6CidrBlock = ipv6CidrBlock; } /** *
* The IPv6 network range for the subnet, in CIDR notation. The subnet size must use a /64 prefix length. *
** This parameter is required for an IPv6 only subnet. *
* * @return The IPv6 network range for the subnet, in CIDR notation. The subnet size must use a /64 prefix * length. ** This parameter is required for an IPv6 only subnet. */ public String getIpv6CidrBlock() { return this.ipv6CidrBlock; } /** *
* The IPv6 network range for the subnet, in CIDR notation. The subnet size must use a /64 prefix length. *
** This parameter is required for an IPv6 only subnet. *
* * @param ipv6CidrBlock * The IPv6 network range for the subnet, in CIDR notation. The subnet size must use a /64 prefix length. ** This parameter is required for an IPv6 only subnet. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateSubnetRequest withIpv6CidrBlock(String ipv6CidrBlock) { setIpv6CidrBlock(ipv6CidrBlock); return this; } /** *
* The Amazon Resource Name (ARN) of the Outpost. If you specify an Outpost ARN, you must also specify the * Availability Zone of the Outpost subnet. *
* * @param outpostArn * The Amazon Resource Name (ARN) of the Outpost. If you specify an Outpost ARN, you must also specify the * Availability Zone of the Outpost subnet. */ public void setOutpostArn(String outpostArn) { this.outpostArn = outpostArn; } /** ** The Amazon Resource Name (ARN) of the Outpost. If you specify an Outpost ARN, you must also specify the * Availability Zone of the Outpost subnet. *
* * @return The Amazon Resource Name (ARN) of the Outpost. If you specify an Outpost ARN, you must also specify the * Availability Zone of the Outpost subnet. */ public String getOutpostArn() { return this.outpostArn; } /** ** The Amazon Resource Name (ARN) of the Outpost. If you specify an Outpost ARN, you must also specify the * Availability Zone of the Outpost subnet. *
* * @param outpostArn * The Amazon Resource Name (ARN) of the Outpost. If you specify an Outpost ARN, you must also specify the * Availability Zone of the Outpost subnet. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateSubnetRequest withOutpostArn(String outpostArn) { setOutpostArn(outpostArn); return this; } /** ** The ID of the VPC. *
* * @param vpcId * The ID of the VPC. */ public void setVpcId(String vpcId) { this.vpcId = vpcId; } /** ** The ID of the VPC. *
* * @return The ID of the VPC. */ public String getVpcId() { return this.vpcId; } /** ** The ID of the VPC. *
* * @param vpcId * The ID of the VPC. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateSubnetRequest withVpcId(String vpcId) { setVpcId(vpcId); return this; } /** ** Indicates whether to create an IPv6 only subnet. *
* * @param ipv6Native * Indicates whether to create an IPv6 only subnet. */ public void setIpv6Native(Boolean ipv6Native) { this.ipv6Native = ipv6Native; } /** ** Indicates whether to create an IPv6 only subnet. *
* * @return Indicates whether to create an IPv6 only subnet. */ public Boolean getIpv6Native() { return this.ipv6Native; } /** ** Indicates whether to create an IPv6 only subnet. *
* * @param ipv6Native * Indicates whether to create an IPv6 only subnet. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateSubnetRequest withIpv6Native(Boolean ipv6Native) { setIpv6Native(ipv6Native); return this; } /** ** Indicates whether to create an IPv6 only subnet. *
* * @return Indicates whether to create an IPv6 only subnet. */ public Boolean isIpv6Native() { return this.ipv6Native; } /** * This method is intended for internal use only. Returns the marshaled request configured with additional * parameters to enable operation dry-run. */ @Override public Request