createReplicationSubnetGroup
abstract suspend fun createReplicationSubnetGroup(input: CreateReplicationSubnetGroupRequest): CreateReplicationSubnetGroupResponse
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 action. Optionally, choose Subnet groups in the DMS console, then choose your subnet group. Next, choose Delete from Actions.
Samples
import aws.sdk.kotlin.services.databasemigrationservice.model.Tag
fun main() {
//sampleStart
// Creates a replication subnet group given a list of the subnet IDs in a VPC.
val resp = databaseMigrationClient.createReplicationSubnetGroup {
replicationSubnetGroupIdentifier = "us-west-2ab-vpc-215ds366"
replicationSubnetGroupDescription = "US West subnet group"
subnetIds = listOf<String>(
"subnet-e145356n",
"subnet-58f79200"
)
tags = listOf<Tag>(
Tag {
key = "Acount"
value = "145235"
}
)
}
//sampleEnd
}