DMS Module
View SourceRelease NotesThis module creates an Amazon Database Migration Service (DMS) that makes it possible to migrate data from one source database to another target database. You can use this module to migrate your data into the AWS Cloud or between combinations of cloud and on-premises setups. Currently, this module only support MySQL and MariaDB engine as source and target database. Additional support for more database engine will be added in the future.
Sample Usage
- Terraform
- Terragrunt
# ------------------------------------------------------------------------------------------------------
# DEPLOY GRUNTWORK'S DMS MODULE
# ------------------------------------------------------------------------------------------------------
module "dms" {
source = "git::git@github.com:gruntwork-io/terraform-aws-data-storage.git//modules/dms?ref=v0.32"
# ----------------------------------------------------------------------------------------------------
# REQUIRED VARIABLES
# ----------------------------------------------------------------------------------------------------
# The compute and memory capacity of the replication instance as specified by
# the replication instance class
instance_type = <string>
# The name used to namespace all resources created by these templates,
# including the DB instance (e.g. drupaldb). Must be unique for this region.
# May contain only lowercase alphanumeric characters, hyphens, underscores,
# periods, and spaces.
name = <string>
# Host name of the server.
source_endpoint_server_name = <string>
# A list of subnet ids where the Replication Instance should be deployed. In
# the standard Gruntwork VPC setup, these should be the private persistence
# subnet ids. This is ignored if create_subnet_group=false.
subnet_ids = <list(string)>
# Host name of the server.
target_endpoint_server_name = <string>
# The migration type. Can be one of `full-load` | `cdc` | `full-load-and-cdc`.
task_migration_type = <string>
# An escaped JSON string that contains the table mappings. For information on
# table mapping see
# http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.CustomizingTasks.TableMapping.html
task_table_mappings = <string>
# The id of the VPC in which this Replication Instance should be deployed.
vpc_id = <string>
# ----------------------------------------------------------------------------------------------------
# OPTIONAL VARIABLES
# ----------------------------------------------------------------------------------------------------
# If false, the DMS instance will bind to `instance_subnet_group_id` variable.
create_subnet_group = true
# A map of custom tags to apply to the DMS Instance and the Security Group
# created for it. The key is the tag name and the value is the tag value.
custom_tags = {}
# The amount of storage (in gigabytes) to be initially allocated for the
# replication instance. Min: 5, Max: 6144, Default: 50
instance_allocated_storage = null
# Indicates that major version upgrades are allowed
instance_allow_major_version_upgrade = true
# Indicates whether the changes should be applied immediately or during the
# next maintenance window
instance_apply_immediately = null
# Indicates that minor engine upgrades will be applied automatically to the
# replication instance during the maintenance window
instance_auto_minor_version_upgrade = true
# The EC2 Availability Zone that the replication instance will be created in
instance_availability_zone = null
# The [engine
# version](https://docs.aws.amazon.com/dms/latest/userguide/CHAP_ReleaseNotes.html)
# number of the replication instance
instance_engine_version = null
# The replication instance identifier. This parameter is stored as a lowercase
# string
instance_id = null
# The Amazon Resource Name (ARN) for the KMS key that will be used to encrypt
# the connection parameters
instance_kms_key_arn = null
# Specifies if the replication instance is a multi-az deployment. You cannot
# set the `availability_zone` parameter if the `multi_az` parameter is set to
# `true`
instance_multi_az = null
# The weekly time range during which system maintenance can occur, in
# Universal Coordinated Time (UTC)
instance_preferred_maintenance_window = null
# Specifies the accessibility options for the replication instance
instance_publicly_accessible = null
# An existing subnet group to associate with the replication instance
instance_subnet_group_id = null
# A map of additional tags to apply to the replication instance
instance_tags = {}
# A map of timeouts for replication instance create/update/delete operations
instance_timeouts = {}
# A list of VPC security group IDs to be used with the replication instance
instance_vpc_security_group_ids = null
# Name of the endpoint database
source_endpoint_database_name = null
# Type of engine for the endpoint.
source_endpoint_engine_name = "mysql"
# Additional attributes associated with the connection. For available
# attributes for a source Endpoint, see
# https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.html. For
# available attributes for a target Endpoint, see
# https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Target.html.
source_endpoint_extra_connection_attributes = null
# ARN for the KMS key that will be used to encrypt the connection parameters.
# If you do not specify a value for kms_key_arn, then AWS DMS will use your
# default encryption key. AWS KMS creates the default encryption key for your
# AWS account. Your AWS account has a different default encryption key for
# each AWS region
source_endpoint_kms_key_arn = null
# Password to be used to login to the endpoint database.
source_endpoint_password = null
# Port used by the endpoint database.
source_endpoint_port = null
# SSL mode to use for the connection. Valid values are none, require,
# verify-ca, verify-full
source_endpoint_ssl_mode = "none"
# User name to be used to login to the endpoint database.
source_endpoint_username = null
# The description of the aws_dms_replication_subnet_group that is created.
# Defaults to 'Subnet group for the var.name DB' if not specified.
subnet_group_description = null
# The name of the aws_dms_replication_subnet_group that is created, or an
# existing one to use if create_subnet_group is false. Defaults to var.name if
# not specified.
subnet_group_name = null
# Name of the endpoint database
target_endpoint_database_name = null
# Type of engine for the endpoint.
target_endpoint_engine_name = "mysql"
# Additional attributes associated with the connection. For available
# attributes for a source Endpoint, see
# https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.html. For
# available attributes for a target Endpoint, see
# https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Target.html.
target_endpoint_extra_connection_attributes = null
# ARN for the KMS key that will be used to encrypt the connection parameters.
# If you do not specify a value for kms_key_arn, then AWS DMS will use your
# default encryption key. AWS KMS creates the default encryption key for your
# AWS account. Your AWS account has a different default encryption key for
# each AWS region
target_endpoint_kms_key_arn = null
# Password to be used to login to the endpoint database.
target_endpoint_password = null
# Port used by the endpoint database.
target_endpoint_port = null
# SSL mode to use for the connection. Valid values are none, require,
# verify-ca, verify-full
target_endpoint_ssl_mode = "none"
# User name to be used to login to the endpoint database.
target_endpoint_username = null
# (Conflicts with task_cdc_start_time) Indicates when you want a change data
# capture (CDC) operation to start. The value can be in date, checkpoint, or
# LSN/SCN format depending on the source engine. For more information, see
# https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Task.CDC.html#CHAP_Task.CDC.StartPoint.Native.
task_cdc_start_position = null
# (Conflicts with task_cdc_start_position) The Unix timestamp integer for the
# start of the Change Data Capture (CDC) operation.
task_cdc_start_time = null
# An escaped JSON string that contains the task settings. For a complete list
# of task settings, see
# http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.CustomizingTasks.TaskSettings.html.
task_settings = null
# Whether to run or stop the replication task.
task_start_replication_task = false
}
# ------------------------------------------------------------------------------------------------------
# DEPLOY GRUNTWORK'S DMS MODULE
# ------------------------------------------------------------------------------------------------------
terraform {
source = "git::git@github.com:gruntwork-io/terraform-aws-data-storage.git//modules/dms?ref=v0.32"
}
inputs = {
# ----------------------------------------------------------------------------------------------------
# REQUIRED VARIABLES
# ----------------------------------------------------------------------------------------------------
# The compute and memory capacity of the replication instance as specified by
# the replication instance class
instance_type = <string>
# The name used to namespace all resources created by these templates,
# including the DB instance (e.g. drupaldb). Must be unique for this region.
# May contain only lowercase alphanumeric characters, hyphens, underscores,
# periods, and spaces.
name = <string>
# Host name of the server.
source_endpoint_server_name = <string>
# A list of subnet ids where the Replication Instance should be deployed. In
# the standard Gruntwork VPC setup, these should be the private persistence
# subnet ids. This is ignored if create_subnet_group=false.
subnet_ids = <list(string)>
# Host name of the server.
target_endpoint_server_name = <string>
# The migration type. Can be one of `full-load` | `cdc` | `full-load-and-cdc`.
task_migration_type = <string>
# An escaped JSON string that contains the table mappings. For information on
# table mapping see
# http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.CustomizingTasks.TableMapping.html
task_table_mappings = <string>
# The id of the VPC in which this Replication Instance should be deployed.
vpc_id = <string>
# ----------------------------------------------------------------------------------------------------
# OPTIONAL VARIABLES
# ----------------------------------------------------------------------------------------------------
# If false, the DMS instance will bind to `instance_subnet_group_id` variable.
create_subnet_group = true
# A map of custom tags to apply to the DMS Instance and the Security Group
# created for it. The key is the tag name and the value is the tag value.
custom_tags = {}
# The amount of storage (in gigabytes) to be initially allocated for the
# replication instance. Min: 5, Max: 6144, Default: 50
instance_allocated_storage = null
# Indicates that major version upgrades are allowed
instance_allow_major_version_upgrade = true
# Indicates whether the changes should be applied immediately or during the
# next maintenance window
instance_apply_immediately = null
# Indicates that minor engine upgrades will be applied automatically to the
# replication instance during the maintenance window
instance_auto_minor_version_upgrade = true
# The EC2 Availability Zone that the replication instance will be created in
instance_availability_zone = null
# The [engine
# version](https://docs.aws.amazon.com/dms/latest/userguide/CHAP_ReleaseNotes.html)
# number of the replication instance
instance_engine_version = null
# The replication instance identifier. This parameter is stored as a lowercase
# string
instance_id = null
# The Amazon Resource Name (ARN) for the KMS key that will be used to encrypt
# the connection parameters
instance_kms_key_arn = null
# Specifies if the replication instance is a multi-az deployment. You cannot
# set the `availability_zone` parameter if the `multi_az` parameter is set to
# `true`
instance_multi_az = null
# The weekly time range during which system maintenance can occur, in
# Universal Coordinated Time (UTC)
instance_preferred_maintenance_window = null
# Specifies the accessibility options for the replication instance
instance_publicly_accessible = null
# An existing subnet group to associate with the replication instance
instance_subnet_group_id = null
# A map of additional tags to apply to the replication instance
instance_tags = {}
# A map of timeouts for replication instance create/update/delete operations
instance_timeouts = {}
# A list of VPC security group IDs to be used with the replication instance
instance_vpc_security_group_ids = null
# Name of the endpoint database
source_endpoint_database_name = null
# Type of engine for the endpoint.
source_endpoint_engine_name = "mysql"
# Additional attributes associated with the connection. For available
# attributes for a source Endpoint, see
# https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.html. For
# available attributes for a target Endpoint, see
# https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Target.html.
source_endpoint_extra_connection_attributes = null
# ARN for the KMS key that will be used to encrypt the connection parameters.
# If you do not specify a value for kms_key_arn, then AWS DMS will use your
# default encryption key. AWS KMS creates the default encryption key for your
# AWS account. Your AWS account has a different default encryption key for
# each AWS region
source_endpoint_kms_key_arn = null
# Password to be used to login to the endpoint database.
source_endpoint_password = null
# Port used by the endpoint database.
source_endpoint_port = null
# SSL mode to use for the connection. Valid values are none, require,
# verify-ca, verify-full
source_endpoint_ssl_mode = "none"
# User name to be used to login to the endpoint database.
source_endpoint_username = null
# The description of the aws_dms_replication_subnet_group that is created.
# Defaults to 'Subnet group for the var.name DB' if not specified.
subnet_group_description = null
# The name of the aws_dms_replication_subnet_group that is created, or an
# existing one to use if create_subnet_group is false. Defaults to var.name if
# not specified.
subnet_group_name = null
# Name of the endpoint database
target_endpoint_database_name = null
# Type of engine for the endpoint.
target_endpoint_engine_name = "mysql"
# Additional attributes associated with the connection. For available
# attributes for a source Endpoint, see
# https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.html. For
# available attributes for a target Endpoint, see
# https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Target.html.
target_endpoint_extra_connection_attributes = null
# ARN for the KMS key that will be used to encrypt the connection parameters.
# If you do not specify a value for kms_key_arn, then AWS DMS will use your
# default encryption key. AWS KMS creates the default encryption key for your
# AWS account. Your AWS account has a different default encryption key for
# each AWS region
target_endpoint_kms_key_arn = null
# Password to be used to login to the endpoint database.
target_endpoint_password = null
# Port used by the endpoint database.
target_endpoint_port = null
# SSL mode to use for the connection. Valid values are none, require,
# verify-ca, verify-full
target_endpoint_ssl_mode = "none"
# User name to be used to login to the endpoint database.
target_endpoint_username = null
# (Conflicts with task_cdc_start_time) Indicates when you want a change data
# capture (CDC) operation to start. The value can be in date, checkpoint, or
# LSN/SCN format depending on the source engine. For more information, see
# https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Task.CDC.html#CHAP_Task.CDC.StartPoint.Native.
task_cdc_start_position = null
# (Conflicts with task_cdc_start_position) The Unix timestamp integer for the
# start of the Change Data Capture (CDC) operation.
task_cdc_start_time = null
# An escaped JSON string that contains the task settings. For a complete list
# of task settings, see
# http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.CustomizingTasks.TaskSettings.html.
task_settings = null
# Whether to run or stop the replication task.
task_start_replication_task = false
}
Reference
- Inputs
- Outputs
Required
instance_typestringThe compute and memory capacity of the replication instance as specified by the replication instance class
namestringThe name used to namespace all resources created by these templates, including the DB instance (e.g. drupaldb). Must be unique for this region. May contain only lowercase alphanumeric characters, hyphens, underscores, periods, and spaces.
Host name of the server.
subnet_idslist(string)A list of subnet ids where the Replication Instance should be deployed. In the standard Gruntwork VPC setup, these should be the private persistence subnet ids. This is ignored if create_subnet_group=false.
Host name of the server.
task_migration_typestringThe migration type. Can be one of full-load | cdc | full-load-and-cdc.
task_table_mappingsstringAn escaped JSON string that contains the table mappings. For information on table mapping see http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.CustomizingTasks.TableMapping.html
vpc_idstringThe id of the VPC in which this Replication Instance should be deployed.
Optional
If false, the DMS instance will bind to instance_subnet_group_id variable.
truecustom_tagsmap(string)A map of custom tags to apply to the DMS Instance and the Security Group created for it. The key is the tag name and the value is the tag value.
{}The amount of storage (in gigabytes) to be initially allocated for the replication instance. Min: 5, Max: 6144, Default: 50
nullIndicates that major version upgrades are allowed
trueIndicates whether the changes should be applied immediately or during the next maintenance window
nullIndicates that minor engine upgrades will be applied automatically to the replication instance during the maintenance window
trueThe EC2 Availability Zone that the replication instance will be created in
nullinstance_engine_versionstringThe engine version number of the replication instance
nullinstance_idstringThe replication instance identifier. This parameter is stored as a lowercase string
nullinstance_kms_key_arnstringThe Amazon Resource Name (ARN) for the KMS key that will be used to encrypt the connection parameters
nullSpecifies if the replication instance is a multi-az deployment. You cannot set the availability_zone parameter if the multi_az parameter is set to true
nullThe weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC)
nullSpecifies the accessibility options for the replication instance
nullinstance_subnet_group_idstringAn existing subnet group to associate with the replication instance
nullinstance_tagsmap(string)A map of additional tags to apply to the replication instance
{}instance_timeoutsmap(string)A map of timeouts for replication instance create/update/delete operations
{}instance_vpc_security_group_idslist(string)A list of VPC security group IDs to be used with the replication instance
nullName of the endpoint database
nullType of engine for the endpoint.
"mysql"Additional attributes associated with the connection. For available attributes for a source Endpoint, see https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.html. For available attributes for a target Endpoint, see https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Target.html.
nullARN for the KMS key that will be used to encrypt the connection parameters. If you do not specify a value for kms_key_arn, then AWS DMS will use your default encryption key. AWS KMS creates the default encryption key for your AWS account. Your AWS account has a different default encryption key for each AWS region
nullsource_endpoint_passwordstringPassword to be used to login to the endpoint database.
nullsource_endpoint_portnumberPort used by the endpoint database.
nullsource_endpoint_ssl_modestringSSL mode to use for the connection. Valid values are none, require, verify-ca, verify-full
"none"source_endpoint_usernamestringUser name to be used to login to the endpoint database.
nullsubnet_group_descriptionstringThe description of the aws_dms_replication_subnet_group that is created. Defaults to 'Subnet group for the name DB' if not specified.
nullsubnet_group_namestringThe name of the aws_dms_replication_subnet_group that is created, or an existing one to use if create_subnet_group is false. Defaults to name if not specified.
nullName of the endpoint database
nullType of engine for the endpoint.
"mysql"Additional attributes associated with the connection. For available attributes for a source Endpoint, see https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.html. For available attributes for a target Endpoint, see https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Target.html.
nullARN for the KMS key that will be used to encrypt the connection parameters. If you do not specify a value for kms_key_arn, then AWS DMS will use your default encryption key. AWS KMS creates the default encryption key for your AWS account. Your AWS account has a different default encryption key for each AWS region
nulltarget_endpoint_passwordstringPassword to be used to login to the endpoint database.
nulltarget_endpoint_portnumberPort used by the endpoint database.
nulltarget_endpoint_ssl_modestringSSL mode to use for the connection. Valid values are none, require, verify-ca, verify-full
"none"target_endpoint_usernamestringUser name to be used to login to the endpoint database.
nulltask_cdc_start_positionstring(Conflicts with task_cdc_start_time) Indicates when you want a change data capture (CDC) operation to start. The value can be in date, checkpoint, or LSN/SCN format depending on the source engine. For more information, see https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Task.CDC.html#CHAP_Task.CDC.StartPoint.Native.
nulltask_cdc_start_timestring(Conflicts with task_cdc_start_position) The Unix timestamp integer for the start of the Change Data Capture (CDC) operation.
nulltask_settingsstringAn escaped JSON string that contains the task settings. For a complete list of task settings, see http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.CustomizingTasks.TaskSettings.html.
nullWhether to run or stop the replication task.
falseA map of maps containing the endpoints created and their full output of attributes and values
The Amazon Resource Name (ARN) of the replication instance
A list of the private IP addresses of the replication instance
A list of the public IP addresses of the replication instance
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block
The ID of the subnet group
A map of maps containing the replication tasks created and their full output of attributes and values