AWS DMS Replication Subnet Group
This page shows how to write Terraform and CloudFormation for AWS DMS Replication Subnet Group and write them securely.
aws_dms_replication_subnet_group (Terraform)
The Replication Subnet Group in AWS DMS can be configured in Terraform with the resource name aws_dms_replication_subnet_group
. The following sections describe 2 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "aws_dms_replication_subnet_group" "dms-subnet-group" {
replication_subnet_group_description = "subnet group for DMS"
replication_subnet_group_id = "dms-subnet-group"
subnet_ids = [ "subnet-08028120cbe0274fc",
"subnet-013d2eda039a14bf5", "subnet-01ffafbd540cf34e9"
]
resource "aws_dms_replication_subnet_group" "this" {
replication_subnet_group_description = var.replication_subnet_group_description
replication_subnet_group_id = var.replication_subnet_group_id
subnet_ids = var.subnet_ids
tags = var.tags
}
Parameters
-
id
optional computed - string -
replication_subnet_group_arn
optional computed - string -
replication_subnet_group_description
required - string -
replication_subnet_group_id
required - string -
subnet_ids
required - set of string -
tags
optional - map from string to string -
vpc_id
optional computed - string
Explanation in Terraform Registry
Provides a DMS (Data Migration Service) replication subnet group resource. DMS replication subnet groups can be created, updated, deleted, and imported.
AWS::DMS::ReplicationSubnetGroup (CloudFormation)
The ReplicationSubnetGroup in DMS can be configured in CloudFormation with the resource name AWS::DMS::ReplicationSubnetGroup
. The following sections describe 10 examples of how to use the resource and its parameters.
Example Usage from GitHub
Type: AWS::DMS::ReplicationSubnetGroup
Properties:
ReplicationSubnetGroupDescription: Subnets available for DMS
SubnetIds:
- Fn::ImportValue: !Sub '${EnvironmentName}:PublicSubnet1'
- Fn::ImportValue: !Sub '${EnvironmentName}:PublicSubnet2'
Type: 'AWS::DMS::ReplicationSubnetGroup'
Properties:
ReplicationSubnetGroupDescription: Subnets available for DMS
SubnetIds:
- !Ref DBSubnet1
- !Ref DBSubnet2
# Type: AWS::DMS::ReplicationSubnetGroup
# Properties:
# ReplicationSubnetGroupIdentifier: replication-subnet-group
# ReplicationSubnetGroupDescription: Subnet group for DMS
# SubnetIds:
# - !Ref RDSPrivateSubnet1
Type: 'AWS::DMS::ReplicationSubnetGroup'
Properties:
ReplicationSubnetGroupDescription: Subnets available for DMS
SubnetIds:
- !Ref DBSubnet1
- !Ref DBSubnet2
Type: AWS::DMS::ReplicationSubnetGroup
Properties:
ReplicationSubnetGroupIdentifier: "dmstestreplicationgroup"
ReplicationSubnetGroupDescription: "Test DMS Replication Group"
SubnetIds:
- !Ref SubnetA
"Type" : "AWS::DMS::ReplicationSubnetGroup",
"Properties" : {
"ReplicationSubnetGroupIdentifier" : "DMS-SubnetGrp",
"ReplicationSubnetGroupDescription" : "Subnets available for DMS",
"SubnetIds" : [ { "Ref" : "ExistingSubnet1" }, { "Ref" : "ExistingSubnet2" } ],
}
"Type" : "AWS::DMS::ReplicationSubnetGroup",
"Properties" : {
"ReplicationSubnetGroupIdentifier": "{{dmssubnet}}",
"ReplicationSubnetGroupDescription": "{{settings["description"]}}",
"SubnetIds" : [
{% for subnet in settings["subnets"] %}
"AWS::DMS::ReplicationSubnetGroup": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dms-replicationsubnetgroup.html",
"Properties": {
"ReplicationSubnetGroupDescription": {
"Required": true,
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dms-replicationsubnetgroup.html#cfn-dms-replicationsubnetgroup-replicationsubnetgroupdescription",
"AWS::DMS::ReplicationSubnetGroup": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dms-replicationsubnetgroup.html",
"Properties": {
"ReplicationSubnetGroupDescription": {
"Required": true,
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dms-replicationsubnetgroup.html#cfn-dms-replicationsubnetgroup-replicationsubnetgroupdescription",
"AWS::DMS::ReplicationSubnetGroup": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dms-replicationsubnetgroup.html",
"Properties": {
"ReplicationSubnetGroupDescription": {
"Required": true,
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dms-replicationsubnetgroup.html#cfn-dms-replicationsubnetgroup-replicationsubnetgroupdescription",
Parameters
-
ReplicationSubnetGroupDescription
required - String -
ReplicationSubnetGroupIdentifier
optional - String -
SubnetIds
required - List -
Tags
optional - List of Tag
Explanation in CloudFormation Registry
The
AWS::DMS::ReplicationSubnetGroup
resource creates an AWS DMS replication subnet group. Subnet groups must contain at least two subnets in two different Availability Zones in the same region.Note Resource creation will fail if the
dms-vpc-role
IAM role doesn't already exist. For more information, see Creating the IAM Roles to Use With the AWS CLI and AWS DMS API in the *AWS Database Migration Service User Guide.
Frequently asked questions
What is AWS DMS Replication Subnet Group?
AWS DMS Replication Subnet Group is a resource for DMS of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.
Where can I find the example code for the AWS DMS Replication Subnet Group?
For Terraform, the devopsbynaresh/datalake-alsac and niveklabs/aws source code examples are useful. See the Terraform Example section for further details.
For CloudFormation, the alesabater/customer360, aws-samples/aws-service-catalog-for-data-lake-hydration and OmarKhayyam/data-lake-ws source code examples are useful. See the CloudFormation Example section for further details.