You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
resource "mongodb_db_user" "main" {
auth_database = var.auth_database
name = var.username
password = random_password.main.result
dynamic "role" {
for_each = var.roles
content {
role = role.value.role
db = role.value.db
}
}
}
Terraform plan
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
# mongodb_db_user.main will be created
+ resource "mongodb_db_user" "main" {
+ auth_database = "admin"
+ id = (known after apply)
+ name = "some_user"
+ password = (sensitive)
+ role {
+ db = "admin"
+ role = "readAnyDatabase"
}
}
Plan: 1 to add, 0 to change, 0 to destroy.
Error from debug log
2022-09-15T17:19:50.527+0300 [DEBUG] provider: plugin exited
2022-09-15T17:19:50.529+0300 [DEBUG] provider.terraform-provider-mongodb_0.1.5: 2022/09/15 17:19:50 [WARN] Truncating attribute path of 0 diagnostics for TypeSet
mongodb_db_user.main: Creating...
2022-09-15T17:19:50.532+0300 [INFO] Starting apply for mongodb_db_user.main
2022-09-15T17:19:50.533+0300 [DEBUG] mongodb_db_user.main: applying the planned Create change
mongodb_db_user.main: Still creating... [10s elapsed]
2022-09-15T17:20:00.544+0300 [ERROR] vertex "mongodb_db_user.main" error: Error connecting to database : server selection error: context deadline exceeded, current topology: { Type: ReplicaSetNoPrimary, Servers: [{ Addr: some_server.some_id.eu-central-1.docdb.amazonaws.com:27017, Type: Unknown }, ] }
What am I doing wrong? Please assist
The text was updated successfully, but these errors were encountered:
I have 2 dns
1st - internal VPN dns
2nd - CloudFlare DNS 1.1.1.1
I think provider checks only first DNS which can't resolve DocumentDB host and it's crashes without any attempt to check with 2nd DNS.
After removing 1st DNS it's start working.
Hello, I've landed here after investigating a similar error and wanted to share another case when this could happen.
Conditions are:
you are changing the tls option (in my case it was tls=on -> off) or adding security group (changing basically the reachability of the cluster
apply_method is set to "pending-reboot" (cluster or parameter group does not matter, important is that the change is not applied immediately)
cluster is unreachable due to this pending change
I know it seems obvious, but it might point someone as tired as me to the right direction after reading this 😃 Cheers and thanks for all the good work on this provider.
Hello.
I have an issue with connection to AWS DocumentDB
Terraform version:
Provider configuration
Resource code
Terraform plan
Error from debug log
What am I doing wrong? Please assist
The text was updated successfully, but these errors were encountered: