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" #9200

Closed
ghost opened this issue Jul 2, 2019 · 3 comments
Closed

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

ghost opened this issue Jul 2, 2019 · 3 comments

Comments

@ghost
Copy link

ghost commented Jul 2, 2019

This issue was originally opened by Alien2150 as hashicorp/terraform#21918. It was migrated here as a result of the provider split. The original body of the issue is below.


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
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Jul 2, 2019
@Alien2150
Copy link

@ewbankkit Sounds familiar. Think it can be closed

@bflad bflad closed this as completed Aug 13, 2019
@ghost
Copy link
Author

ghost commented Nov 1, 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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Nov 1, 2019
@breathingdust breathingdust removed the needs-triage Waiting for first response or review from a maintainer. label Sep 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants