Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS DMS Tasks fails with "Invalid task settings JSON" #21918

Closed
Alien2150 opened this issue Jun 27, 2019 · 2 comments
Closed

AWS DMS Tasks fails with "Invalid task settings JSON" #21918

Alien2150 opened this issue Jun 27, 2019 · 2 comments

Comments

@Alien2150
Copy link

Hello there,

I noticed something odd when using the terraform dms task module. So what I could see is that terraform apply for the first time will create the task. Rerunning it afterwards with the same settings will crash it.

Terraform Version

Terraform v0.11.13
+ provider.aws v1.60.0

Terraform Configuration Files

# Setup dms aurora -> redshift
resource "aws_dms_endpoint" "source" {
  endpoint_id   = "source-db-${terraform.workspace}"
  endpoint_type = "source"
  engine_name   = "postgres"
  port          = "${element(split(":", var.bi_export_db_source_host), 1)}"
  server_name   = "${element(split(":", var.bi_export_db_source_host), 0)}"
  database_name = "${var.bi_export_db_source_name}"
  password      = "${var.bi_export_db_source_password}"
  username      = "${var.bi_export_db_source_username}"
}

resource "aws_dms_endpoint" "target" {
  endpoint_id   = "target-db-${terraform.workspace}"
  endpoint_type = "target"
  engine_name   = "redshift"
  # Redshift creds
  port          = "${element(split(":", var.bi_export_db_target_host), 1)}"
  server_name   = "${element(split(":", var.bi_export_db_target_host), 0)}"
  database_name = "${var.bi_export_db_target_name}"
  password      = "${var.bi_export_db_target_password}"
  username      = "${var.bi_export_db_target_username}"
}


resource "aws_dms_replication_subnet_group" "replication_subnet_group" {
  replication_subnet_group_description = "Subnet Replication Group ${terraform.workspace}"
  replication_subnet_group_id          = "subnet-group-${terraform.workspace}"
  subnet_ids                           = ["${data.aws_subnet_ids.private-subnet-ids.ids}"]
  tags                                 = {
    Environment = "${terraform.workspace}"
  }
}

resource "aws_dms_replication_instance" "replication_instance" {
  allocated_storage           = 40
  auto_minor_version_upgrade  = true
  replication_instance_class  = "${lookup(var.node-type, terraform.workspace)}"
  replication_instance_id     = "bi-migration-${terraform.workspace}"
  engine_version              = "${lookup(var.engine-version, terraform.workspace)}"
  publicly_accessible         = false
  replication_subnet_group_id = "${aws_dms_replication_subnet_group.replication_subnet_group.id}"
  vpc_security_group_ids      = ["${aws_security_group.dms_bi_import.id}", "${aws_security_group.dms_bi_export.id}"]
}


resource "aws_dms_replication_task" "replication_task" {
  migration_type            = "full-load-and-cdc" ## Define type (full-load, cdc, full-load-and-cdc)
  replication_instance_arn  = "${aws_dms_replication_instance.replication_instance.replication_instance_arn}"
  replication_task_id       = "bi-migration-task-${terraform.workspace}"
  source_endpoint_arn       = "${aws_dms_endpoint.source.endpoint_arn}"
  table_mappings            = "${var.table_mapping}" # mapping ... (if needed)
  target_endpoint_arn       = "${aws_dms_endpoint.target.endpoint_arn}"
}

Debug Output

If needed i can provide it

Crash Output

https://gist.github.com/Alien2150/37ff7c67089f1872ce234c09bc456747

Expected Behavior

Tasks should not have be changed.

Actual Behavior

Tasks assumes the task-settings have changed. And wants to recreate and fails with the error message.

Steps to Reproduce

  1. terraform init
  2. terraform apply
  3. terraform apply
@ghost
Copy link

ghost commented Jul 2, 2019

This issue has been automatically migrated to hashicorp/terraform-provider-aws#9200 because it looks like an issue with that provider. If you believe this is not an issue with the provider, please reply to hashicorp/terraform-provider-aws#9200.

@ghost
Copy link

ghost commented Aug 13, 2019

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Aug 13, 2019
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants