MongoDB Atlas: Installation & Configuration
The Pulumi MongoDB Atlas provider uses the MongoDB Atlas SDK to manage and provision resources.
Installation
The MongoDB Atlas provider is available as a package in all Pulumi languages:
- JavaScript/TypeScript:
@pulumi/mongodbatlas
- Python:
pulumi-mongodbatlas
- Go:
github.com/pulumi/pulumi-mongodbatlas/sdk/v3/go/mongodbatlas
- .NET:
Pulumi.Mongodbatlas
- Java:
com.pulumi/mongodbatlas
Configuring Credentials
Pulumi relies on the MongoDB Atlas SDK to authenticate requests from your computer to MongoDB Atlas. Your credentials are never sent to pulumi.com. The Pulumi MongoDB Atlas Provider needs to be configured with MongoDB Atlas credentials before it can be used to manage resources.
In order to communicate your configuration details to Pulumi:
Set the environment variables
MONGODB_ATLAS_PUBLIC_KEY
andMONGODB_ATLAS_PRIVATE_KEY
:$ export MONGODB_ATLAS_PUBLIC_KEY=XXXXXXXXXXXXXX $ export MONGODB_ATLAS_PRIVATE_KEY=YYYYYYYYYYYYYY
Set them using configuration, if you prefer that they be stored alongside your Pulumi stack for easy multi-user access:
$ pulumi config set mongodbatlas:publicKey XXXXXXXXXXXXXX --secret $ pulumi config set mongodbatlas:privateKey YYYYYYYYYYYYYY --secret
If you are going to set mongodbatlas:privateKey
and mongodbatlas:publicKey
, please remember to pass --secret
so that they is properly encrypted. The complete list of
configuration parameters is in the MongoDB Atlas provider README.