AnnouncementIntroducing MongoDB 8.0, the fastest MongoDB ever! Read more >>Introducing MongoDB 8.0, the fastest MongoDB ever! >>

MongoDB and HashiCorp Terraform

Integrate MongoDB Atlas into your continuous delivery workflow using the HashiCorp Terraform MongoDB Atlas Provider to automate your data infrastructure deployments on any cloud provider.
new_workloads

Simplify infrastructure management

Fully automate deployment of MongoDB Atlas resources as code, including provisioning access controls, networking, encryption at rest, backups, and more.

mdb_migrator

Standardize and control workflows

Deploy MongoDB Atlas in the same workflow as other resources and ensure consistency across teams by creating modules for standard configurations in Terraform.

mdb_migration_success

Cloud-first and platform-agnostic

Whatever type of environment you run on, HashiCorp Terraform and MongoDB Atlas make it easy to provision infrastructure with support for all major cloud providers, including AWS, Microsoft Azure, and Google Cloud.

How to use MongoDB Atlas and HashiCorp Terraform

The HashiCorp Terraform MongoDB Atlas Provider is the official plugin verified and tested by HashiCorp for managing MongoDB Atlas using Terraform.
Illustration of a hands typing on laptop.
number_1_inversenumber_1_inverse
Sign up for MongoDB Atlas
If you don’t already use MongoDB Atlas, sign up for an account today. Distributed and secure by default, MongoDB Atlas is a global cloud database service available on all major cloud providers, including AWS, Microsoft Azure, and Google Cloud.Get started
Configure HashiCorp Terraform
number_2_inversenumber_2_inverse
Configure HashiCorp Terraform
To use the HashiCorp Terraform MongoDB Atlas Provider, you must first configure it with the proper credentials. Provide your credentials for authentication via static credentials or environment variables, then simply define your desired Atlas resources.Use the provider
Integration of Terraform and MongoDB Atlas
number_3_inversenumber_3_inverse
Deploy!
Once you’ve created your MongoDB Atlas account and configured your Terraform environment, the Terraform Provider works on your behalf to create Atlas resources in the environment of your choice.View docs
This is an image
Customers Using HashiCorp Terraform and MongoDB Atlas
Learn about Liberty Mutual's journey to the cloud and how it uses the HashiCorp Terraform MongoDB Atlas Provider.

MongoDB support for Terraform CDK (CDKTF)

Deploy and manage infrastructure as code with more flexibility by using the CDKTF to easily deploy Atlas infrastructure to the cloud.
Learn More
Read blog
new_workloads

Increase Productivity

Deploy infrastructure as code without context switching between languages and use the same tooling and syntax to provision resources.

mdb_migrator

Streamline Collaboration

Leverage Terraform infrastructure automation using familiar syntax and established deployment pipelines to configure the infrastructure.

mdb_migration_success

Reduce Complexities

Avoid code duplication by creating custom abstraction layers to simplify development and speed up the delivery of new features and services.

MongoDB Atlas and HashiCorp Terraform FAQ

What is MongoDB Atlas?

MongoDB Atlas is a fully managed cloud database service that simplifies deploying, managing, and scaling MongoDB.

Who is HashiCorp?
HashiCorp provides open-source tools and commercial products for infrastructure automation, focusing on cloud provisioning, security, networking, and application deployment, including HashiCorp Terraform.
What is HashiCorp Terraform?
HashiCorp Terraform is a tool that provides a foundation for cloud infrastructure automation using infrastructure as code for provisioning and compliance in the cloud operating model. Operators can easily provision and manage any infrastructure with one workflow and on-demand using a library of approved infrastructure modules. Terraform is offered both as an open source and enterprise solution, with the enterprise product building on the open source to address organizational challenges and complexity.
What is the Terraform MongoDB Atlas Provider?
The Terraform MongoDB Atlas Provider makes it easy to deploy, update, and manage Atlas configurations as code through Terraform. With the Terraform plugin for Atlas, DevOps teams can simplify data infrastructure management and control the use of Atlas across the organization. Developers can quickly and easily deploy standardized clusters in testing, QA, and production environments.
What resources are supported by the HashiCorp Terraform MongoDB Atlas Provider?
The Terraform MongoDB Atlas Provider supports almost all resources of the Atlas Admin API, including deploying shared-tier, dedicated, and serverless clusters, creating private endpoints, creating cloud backups, and alert configurations. For a complete list, see Terraform Docs.
I’m interested in a resource not currently supported by the Terraform MongoDB Atlas Provider. What should I do?
Let us know of any or all feature requests (or upvote existing ones).
Who is supporting the HashiCorp Terraform MongoDB Atlas Provider?
The Terraform provider is the official plugin verified by MongoDB. You can download the latest version of our Terraform Provider here.
Does MongoDB Atlas integrate with any other HashiCorp products?
Currently, MongoDB Atlas also integrates with HashiCorp Vault, a secrets management tool that securely stores, manages, and controls access to sensitive data like programmatic API keys and database user credentials.

Ready to get started?

Deploy MongoDB Atlas using the HashiCorp Terraform MongoDB Atlas Provider today.
Get Started
Illustration of a hands typing on laptop.