Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions snippets/atlas-terraform.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"# First step is to create a MongoDB Atlas account",
"# https://www.mongodb.com/docs/atlas/tutorial/create-atlas-account/",
"#",
"# Then create an organization and programmatic API key",
"# Then create an organization and a service account in it",
"# https://www.mongodb.com/docs/atlas/tutorial/manage-organizations/",
"# https://www.mongodb.com/docs/atlas/tutorial/manage-programmatic-access/",
"# https://www.mongodb.com/docs/atlas/configure-api-access/",
"#",
"# Terraform MongoDB Atlas Provider Documentation",
"# https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs",
Expand All @@ -24,10 +24,10 @@
"# Do not check a file containing these variables in a public repository",
"",
"locals {",
" # Replace ORG_ID, PUBLIC_KEY and PRIVATE_KEY with your Atlas variables",
" mongodb_atlas_api_pub_key = \"PUBLIC_KEY\"",
" mongodb_atlas_api_pri_key = \"PRIVATE_KEY\"",
" mongodb_atlas_org_id = \"ORG_ID\"",
" # Replace ORG_ID, CLIENT_ID and CLIENT_SECRET with your Atlas variables",
" mongodb_atlas_org_id = \"ORG_ID\"",
" mongodb_atlas_client_id = \"CLIENT_ID\"",
" mongodb_atlas_client_secret = \"CLIENT_SECRET\"",
"",
" # Replace USERNAME And PASSWORD with what you want for your database user",
" mongodb_atlas_database_username = \"USERNAME\"",
Expand All @@ -49,9 +49,12 @@
" }",
"}",
"",
"# Service accounts are the recommended authentication method.",
"# API keys (public_key/private_key) are also supported. See:",
"# https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/guides/provider-configuration#service-account-recommended",
"provider \"mongodbatlas\" {",
" public_key = local.mongodb_atlas_api_pub_key",
" private_key = local.mongodb_atlas_api_pri_key",
" client_id = local.mongodb_atlas_client_id",
" client_secret = local.mongodb_atlas_client_secret",
"}",
"",
"#",
Expand Down