From e8fe0faeea202fef7764de6ed4fa3ebd3616f9b7 Mon Sep 17 00:00:00 2001 From: Kevin Lefevre Date: Tue, 21 Jan 2020 10:05:23 +0100 Subject: [PATCH] feat: add output and replication task settings Signed-off-by: Kevin Lefevre --- examples/replication_tasks.tf | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/examples/replication_tasks.tf b/examples/replication_tasks.tf index 72ef2a6..082c608 100644 --- a/examples/replication_tasks.tf +++ b/examples/replication_tasks.tf @@ -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( { @@ -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 +}