JavaScript required
We’re sorry, but Coda doesn’t work properly without JavaScript enabled.
Skip to content
Gallery
Terraform Digital Ocean Script
Terraform Digital Ocean Script
Terraform Digital Ocean Script v2
Terraform Vercel
Terraform MongoDB(PaidTier)
Terraform MongoDB(FreeTier)
Terraform + Private Repo Clone with SSH Key
Terraform Strapi
Terraform GitHub Secret
Terraform + Secret Manager
Untitled sync page
Terraform GitHub action CronJob
Terraform + Multi Repo Setup
SSO-Ready
More
Share
Explore
Terraform MongoDB(FreeTier)
Create MongoDB Cluster using Terraform
Requisites
mongodb_org_id
mongodb_atlas_public_key
mongodb_atlas_private_key
→ Go to
MongoDBatlas
→ Login in MongoDB Atlas
it will show like this → Create Organization
Organization is created
Go to Organization → settings → Copy Organization ID & save it for further use
Go to Organization → Access Manager → Create API -KEY
Create API-Key
give permission according to your choice
Copy & Store Public-key & Private-key for further use
Now we have
mongodb_org_id
mongodb_atlas_public_key
mongodb_atlas_private_key
Download Terraform
https://releases.hashicorp.com/terraform/1.9.5/terraform_1.9.5_windows_amd64.zip
Extract zip file
→ run terraform.exe
check terraform version
terraform --version
Download code from here
Github
go to Folder → create terraform.tfvars file
add below content
atlas_public_key =
"" # public key
atlas_private_key =
"" # Private Key
atlas_org_id =
"" #Org_id
project_name =
"Test-Demo" #project name
cluster_name =
"Test-Cluster" # Cluster name
provider_instance_size_name =
"M0"
provider_name =
"TENANT"
backing_provider_name =
"AWS"
provider_region_name =
"AP_SOUTH_1"
mongo_db_major_version = 5.0
database_username =
"" #username
database_password =
"" #password
ip_addresses =[”ip_addres_1” , “ip_adress_1” , “ip_address_3”]
# ip-address
→ Save
the file
→ Open Terminal in that Folder
terraform init
terraform plan
terraform apply
in terminal
it print out MongoDB Connection String
e.g. → mongodb+srv://jackk:<password>@test-cluster.jipsy.mongodb.net
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
Ctrl
P
) instead.