Terraform-provider-aws: DMS Endpoint (MongoDB) cannot be tested due to DatabaseName missing

Created on 24 May 2018  ·  3Comments  ·  Source: hashicorp/terraform-provider-aws

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

$ terraform -v
Terraform v0.11.7
+ provider.aws v1.19.0
+ provider.template v1.0.0

Affected Resource(s)

  • aws_dms_endpoint

Terraform Configuration Files

data "aws_kms_alias" "dms" {
  name = "alias/aws/dms"
}

resource "aws_dms_endpoint" "my-endpoint" {
  endpoint_id = "my-endpoint"
  endpoint_type = "source"
  engine_name = "mongodb"

  server_name = "${var.host}"
  port = "${var.port}"
  username = "${var.username}"
  password = "${var.password}"
  database_name = "my-db"

  ssl_mode = "require"
  kms_key_arn = "${data.aws_kms_alias.dms.target_key_arn}"

  mongodb_settings {
    auth_type = "PASSWORD"
    auth_mechanism = "DEFAULT"
    nesting_level = "NONE"
    extract_doc_id = "true"
    auth_source = "admin"
  }

  tags {
    Terraform = "true"
    Environment = "${terraform.workspace}"
  }
}

Expected Behavior

aws dms test-connection --replication-instance-arn <replication_instance_arn> --endpoint-arn <endpoint_arn> tests the source database connection correctly. Passes if the connection info are correct.

Actual Behavior

aws dms test-connection --replication-instance-arn <replication_instance_arn> --endpoint-arn <endpoint_arn> fails with the following error message

There was a problem with the request: DatabaseName is required for MongoDB

even though DatabaseName is correctly specified under MongoDbSettings. Checked against the output of aws dms describe-endpoints | jq '.Endpoints[] | select(.EndpointIdentifier=="my-endpoint")'

{
  "EndpointIdentifier": "my-endpoint",
  "EndpointType": "SOURCE",
  "EngineName": "mongodb",
  "EngineDisplayName": "MongoDB",
  "ExtraConnectionAttributes": "<computed>",
  "Status": "active",
  "KmsKeyId": "<kms_key_id>",
  "EndpointArn": "<computed>",
  "SslMode": "require",
  "MongoDbSettings": {
    "Username": "<username>",
    "ServerName": "<server_name>",
    "Port": <port>,
    "DatabaseName": "my-db",
    "AuthType": "PASSWORD",
    "AuthMechanism": "DEFAULT",
    "NestingLevel": "NONE",
    "ExtractDocId": "true",
    "DocsToInvestigate": "1000",
    "AuthSource": "admin",
    "KmsKeyId": "<kms_key_id>"
  }
}

(Note: The MongoDbSettings.DatabaseName field is present but DatabaseName is missing at the root level above.)

Important Factoids

Looks like DatabaseName needs to be present at the root level as well. I am not certain if that's the case with the rest of the connection info; Username, Password, ServerName and Port.

bug servicdatabasemigrationservice

Most helpful comment

Thanks @microamp! The fix for this (#4636) will release with v1.21.0 of the AWS provider, likely middle of next week.

All 3 comments

Thanks @microamp! The fix for this (#4636) will release with v1.21.0 of the AWS provider, likely middle of next week.

This has been released in version 1.21.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

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!

Was this page helpful?
0 / 5 - 0 ratings