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

DMS Endpoint (MongoDB) cannot be tested due to DatabaseName missing #4635

Closed
microamp opened this issue May 23, 2018 · 3 comments · Fixed by #4636
Closed

DMS Endpoint (MongoDB) cannot be tested due to DatabaseName missing #4635

microamp opened this issue May 23, 2018 · 3 comments · Fixed by #4636
Labels
bug Addresses a defect in current functionality.
Milestone

Comments

@microamp
Copy link
Contributor

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.

@bflad
Copy link
Contributor

bflad commented May 24, 2018

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

@bflad
Copy link
Contributor

bflad commented May 31, 2018

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.

@ghost
Copy link

ghost commented Apr 5, 2020

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 Apr 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality.
Projects
None yet
2 participants