Skip to content
GitHubXDiscord

ReplicationSubnetGroup

The ReplicationSubnetGroup resource allows you to define a Replication Subnet Group for AWS Database Migration Service (DMS) to specify which subnets to use for replication instances. This resource helps ensure that your replication instances can communicate with your data sources and targets in a secure manner.

Create a basic replication subnet group with required properties.

import AWS from "alchemy/aws/control";
const replicationSubnetGroup = await AWS.DMS.ReplicationSubnetGroup("myReplicationSubnetGroup", {
ReplicationSubnetGroupDescription: "My Replication Subnet Group for DMS",
SubnetIds: [
"subnet-0abcdef1234567890",
"subnet-1abcdef1234567890"
],
Tags: [
{ Key: "Environment", Value: "Production" },
{ Key: "Project", Value: "DatabaseMigration" }
]
});

Customize the replication subnet group with an identifier and additional tags.

const advancedReplicationSubnetGroup = await AWS.DMS.ReplicationSubnetGroup("advancedReplicationSubnetGroup", {
ReplicationSubnetGroupDescription: "Advanced Replication Subnet Group for DMS",
ReplicationSubnetGroupIdentifier: "advanced-replication-subnet-group",
SubnetIds: [
"subnet-2abcdef1234567890",
"subnet-3abcdef1234567890"
],
Tags: [
{ Key: "Environment", Value: "Staging" },
{ Key: "Owner", Value: "DevTeam" }
]
});

This example demonstrates how to adopt an existing replication subnet group if it already exists.

const adoptExistingReplicationSubnetGroup = await AWS.DMS.ReplicationSubnetGroup("existingReplicationSubnetGroup", {
ReplicationSubnetGroupDescription: "Adopting an existing Replication Subnet Group",
SubnetIds: [
"subnet-4abcdef1234567890",
"subnet-5abcdef1234567890"
],
adopt: true
});

Demonstrate how to effectively use tags for organization and management.

const taggedReplicationSubnetGroup = await AWS.DMS.ReplicationSubnetGroup("taggedReplicationSubnetGroup", {
ReplicationSubnetGroupDescription: "Replication Subnet Group with best practices tagging",
SubnetIds: [
"subnet-6abcdef1234567890",
"subnet-7abcdef1234567890"
],
Tags: [
{ Key: "CostCenter", Value: "12345" },
{ Key: "Department", Value: "Engineering" },
{ Key: "Project", Value: "DataMigration2023" }
]
});