CreateReplicationSubnetGroup
Creates a replication subnet group given a list of the subnet IDs in a VPC.
The VPC needs to have at least one subnet in at least two availability zones in the Amazon Web Services Region, otherwise the
service will throw a ReplicationSubnetGroupDoesNotCoverEnoughAZs
exception.
If a replication subnet group exists in your Amazon Web Services account, the CreateReplicationSubnetGroup action
returns the following error message: The Replication Subnet Group already exists. In this case, delete
the existing replication subnet group. To do so, use the DeleteReplicationSubnetGroup
Request Syntax
{
"ReplicationSubnetGroupDescription": "string
",
"ReplicationSubnetGroupIdentifier": "string
",
"SubnetIds": [ "string
" ],
"Tags": [
{
"Key": "string
",
"ResourceArn": "string
",
"Value": "string
"
}
]
}
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters.
The request accepts the following data in JSON format.
- ReplicationSubnetGroupDescription
-
The description for the subnet group.
Type: String
Required: Yes
- ReplicationSubnetGroupIdentifier
-
The name for the replication subnet group. This value is stored as a lowercase string.
Constraints: Must contain no more than 255 alphanumeric characters, periods, underscores, or hyphens. Must not be "default".
Example:
mySubnetgroup
Type: String
Required: Yes
- SubnetIds
-
Two or more subnet IDs to be assigned to the subnet group.
Type: Array of strings
Required: Yes
- Tags
-
One or more tags to be assigned to the subnet group.
Type: Array of Tag objects
Required: No
Response Syntax
{
"ReplicationSubnetGroup": {
"ReplicationSubnetGroupDescription": "string",
"ReplicationSubnetGroupIdentifier": "string",
"SubnetGroupStatus": "string",
"Subnets": [
{
"SubnetAvailabilityZone": {
"Name": "string"
},
"SubnetIdentifier": "string",
"SubnetStatus": "string"
}
],
"SupportedNetworkTypes": [ "string" ],
"VpcId": "string"
}
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
- ReplicationSubnetGroup
-
The replication subnet group that was created.
Type: ReplicationSubnetGroup object
Errors
For information about the errors that are common to all actions, see Common Errors.
- AccessDeniedFault
-
Amazon DMS was denied access to the endpoint. Check that the role is correctly configured.
HTTP Status Code: 400
- InvalidSubnet
-
The subnet provided isn't valid.
HTTP Status Code: 400
- ReplicationSubnetGroupDoesNotCoverEnoughAZs
-
The replication subnet group does not cover enough Availability Zones (AZs). Edit the replication subnet group and add more AZs.
HTTP Status Code: 400
- ResourceAlreadyExistsFault
-
The resource you are attempting to create already exists.
HTTP Status Code: 400
- ResourceNotFoundFault
-
The resource could not be found.
HTTP Status Code: 400
- ResourceQuotaExceededFault
-
The quota for this resource quota has been exceeded.
HTTP Status Code: 400
Examples
Example
This example illustrates one usage of CreateReplicationSubnetGroup.
Sample Request
POST / HTTP/1.1
Host: dms.<region>.<domain>
x-amz-Date: <Date>
Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=contenttype;date;host;user-agent;x-amz-date;x-amz-target;x-amzn-requestid,Signature=<Signature>
User-Agent: <UserAgentString>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: AmazonDMSv20160101.CreateReplicationSubnetGroup
{
"ReplicationSubnetGroupIdentifier":"test-subnet-group",
"ReplicationSubnetGroupDescription":"dms testing",
"SubnetIds":[
"subnet-f6dd91af",
"subnet-3605751d",
"subnet-c2daefb5"
],
"Tags":[
{
"Key":"",
"Value":""
}
]
}
Sample Response
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
{
"ReplicationSubnetGroup":{
"ReplicationSubnetGroupDescription":"dms testing",
"Subnets":[
{
"SubnetStatus":"Active",
"SubnetIdentifier":"subnet-f6dd91af",
"SubnetAvailabilityZone":{
"Name":"us-east-1d"
}
},
{
"SubnetStatus":"Active",
"SubnetIdentifier":"subnet-3605751d",
"SubnetAvailabilityZone":{
"Name":"us-east-1b"
}
},
{
"SubnetStatus":"Active",
"SubnetIdentifier":"subnet-c2daefb5",
"SubnetAvailabilityZone":{
"Name":"us-east-1c"
}
}
],
"VpcId":"vpc-6741a603",
"SubnetGroupStatus":"Complete",
"ReplicationSubnetGroupIdentifier":"test-subnet-group"
}
}
See Also
For more information about using this API in one of the language-specific Amazon SDKs, see the following: