mongodbatlas_database_connection
A resource that creates a connection for a database.
resource "mongodbatlas_database_connection" "connection" {
database = "test" # Name of database
connection_type = "Standard" # or Private Endpoint
database_user = "test" # Name of DB_USER
method = "shell" # other options "application | compass | vscode"
# For Standard Connection
ip = "accessAnywhere" # or other IP Address
# For Private Endpoint
endpoint = "" # ID of Private Endpoint
}
OUTPUT ARGUMENTS
- id
- connection_string
1
vote
mack
shared this idea
-
AdminZuhair (Admin, MongoDB) commented
Hi Mack, thanks for feedback! Can you share more about use cases for having a dedicated connection resource? When creating an Atlas Cluster in Terraform, most users simply Output their connection strings directly to terminal. See here to learn more if helpful (see step 12): https://www.mongodb.com/developer/products/atlas/deploy-mongodb-atlas-terraform-aws/
(Edited by admin)