AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.
Container for the parameters to the CreateSecondarySubnet operation. Creates a secondary subnet in a secondary network.
A secondary subnet CIDR block must not overlap with the CIDR block of an existing secondary subnet in the secondary network. After you create a secondary subnet, you can't change its CIDR block.
The allowed size for a secondary subnet CIDR block is between /28 netmask (16 IP addresses) and /12 netmask (1,048,576 IP addresses). Amazon reserves the first four IP addresses and the last IP address in each secondary subnet for internal use.
Namespace: Amazon.EC2.Model
Assembly: AWSSDK.EC2.dll
Version: 3.x.y.z
public class CreateSecondarySubnetRequest : AmazonEC2Request IAmazonWebServiceRequest
The CreateSecondarySubnetRequest type exposes the following members
| Name | Description | |
|---|---|---|
|
CreateSecondarySubnetRequest() |
| Name | Type | Description | |
|---|---|---|---|
|
AvailabilityZone | System.String |
Gets and sets the property AvailabilityZone.
The Availability Zone for the secondary subnet. You cannot specify both |
|
AvailabilityZoneId | System.String |
Gets and sets the property AvailabilityZoneId.
The ID of the Availability Zone for the secondary subnet. This option is preferred
over |
|
ClientToken | System.String |
Gets and sets the property ClientToken. Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see Ensure Idempotency. |
|
DryRun | System.Nullable<System.Boolean> |
Gets and sets the property DryRun.
Checks whether you have the required permissions for the action, without actually
making the request, and provides an error response. If you have the required permissions,
the error response is |
|
Ipv4CidrBlock | System.String |
Gets and sets the property Ipv4CidrBlock. The IPv4 CIDR block for the secondary subnet. The CIDR block size must be between /12 and /28. |
|
SecondaryNetworkId | System.String |
Gets and sets the property SecondaryNetworkId. The ID of the secondary network in which to create the secondary subnet. |
|
TagSpecifications | System.Collections.Generic.List<Amazon.EC2.Model.TagSpecification> |
Gets and sets the property TagSpecifications. The tags to assign to the secondary subnet. Starting with version 4 of the SDK this property will default to null. If no data for this property is returned from the service the property will also be null. This was changed to improve performance and allow the SDK and caller to distinguish between a property not set or a property being empty to clear out a value. To retain the previous SDK behavior set the AWSConfigs.InitializeCollections static property to true. |
This example creates a secondary subnet with a /24 CIDR block in the specified secondary network and Availability Zone.
var client = new AmazonEC2Client();
var response = client.CreateSecondarySubnet(new CreateSecondarySubnetRequest
{
AvailabilityZoneId = "use2-az1",
ClientToken = "550e8400-e29b-41d4-a716-446655440000",
Ipv4CidrBlock = "10.0.0.0/24",
SecondaryNetworkId = "sn-0123456789abcdef0",
TagSpecifications = new List<TagSpecification> {
new TagSpecification {
ResourceType = "secondary-subnet",
Tags = new List<Tag> {
new Tag {
Key = "Name",
Value = "Prod Secondary Subnet"
},
new Tag {
Key = "Environment",
Value = "Production"
}
}
}
}
});
string clientToken = response.ClientToken;
SecondarySubnet secondarySubnet = response.SecondarySubnet;
.NET:
Supported in: 8.0 and newer, Core 3.1
.NET Standard:
Supported in: 2.0
.NET Framework:
Supported in: 4.7.2 and newer