Skip to content

Commit

Permalink
feat: add output and replication task settings
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Lefevre <[email protected]>
  • Loading branch information
ArchiFleKs committed Jan 21, 2020
1 parent 68e4859 commit e8fe0fa
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions examples/replication_tasks.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@ variable "dms_replication_tasks" {
default = {}
}

variable "env" {}

resource "aws_dms_replication_task" "replication_tasks" {
for_each = var.dms_replication_tasks
migration_type = "full-load-and-cdc"
replication_instance_arn = aws_dms_replication_instance.dms-instance.replication_instance_arn
replication_task_id = each.value.name
source_endpoint_arn = aws_dms_endpoint.dms-endpoints[each.key].endpoint_arn
table_mappings = templatefile("templates/table_mapping.tpl", { tables = each.value.tables })
for_each = var.dms_replication_tasks
migration_type = "full-load-and-cdc"
replication_instance_arn = aws_dms_replication_instance.dms-instance.replication_instance_arn
replication_task_id = each.value.name
source_endpoint_arn = aws_dms_endpoint.dms-endpoints[each.key].endpoint_arn
replication_task_settings = templatefile("templates/settings.tpl", { env = var.env, name = each.key })
table_mappings = templatefile("templates/table_mapping.tpl", { tables = each.value.tables })

tags = merge(
{
Expand All @@ -20,3 +23,7 @@ resource "aws_dms_replication_task" "replication_tasks" {

target_endpoint_arn = aws_dms_endpoint.dms-endpoints["reports-dms"].endpoint_arn
}

output "replication_task_arns" {
value = values(aws_dms_replication_task.replication_tasks)[*].replication_task_arn
}

0 comments on commit e8fe0fa

Please sign in to comment.