You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/docs/index.html.markdown
+42-32Lines changed: 42 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,11 +8,13 @@ description: |-
8
8
9
9
# MongoDB Atlas Provider
10
10
11
-
The MongoDB Atlas provider is used to interact with the resources supported by [MongoDB Atlas](https://www.mongodb.com/cloud/atlas). The provider needs to be configured with the proper credentials before it can be used.
11
+
You can use the MongoDB Atlas provider to interact with the resources supported by [MongoDB Atlas](https://www.mongodb.com/cloud/atlas).
12
+
The provider needs to be configured with the proper credentials before it can be used.
12
13
13
14
Use the navigation to the left to read about the available provider resources and data sources.
14
15
15
-
You may want to consider pinning the [provider version](https://www.terraform.io/docs/configuration/providers.html#provider-versions) to ensure you have a chance to review and prepare for changes. Speaking of changes, see [CHANGELOG](https://github.com/mongodb/terraform-provider-mongodbatlas/blob/master/CHANGELOG.md) for current version information.
16
+
You may want to consider pinning the [provider version](https://www.terraform.io/docs/configuration/providers.html#provider-versions) to ensure you have a chance to review and prepare for changes.
17
+
Speaking of changes, see [CHANGELOG](https://github.com/mongodb/terraform-provider-mongodbatlas/blob/master/CHANGELOG.md) for current version information.
16
18
17
19
## Example Usage
18
20
@@ -22,37 +24,25 @@ provider "mongodbatlas" {
22
24
public_key = var.mongodbatlas_public_key
23
25
private_key = var.mongodbatlas_private_key
24
26
}
25
-
26
-
#Create the resources
27
-
...
27
+
# Create the resources
28
28
```
29
29
30
30
## Configure Atlas Programmatic Access
31
31
32
-
In order to setup authentication with the MongoDB Atlas provider a programmatic API key must be generated for MongoDB Atlas with the appropriate permissions and IP access list entries. The [MongoDB Atlas documentation](https://docs.atlas.mongodb.com/tutorial/manage-programmatic-access/index.html) contains the most up-to-date instructions for creating and managing your key(s) and IP access. Be aware, not all API resources require an IP access list by default, but one can set Atlas to require IP access entries for all API resources, see the [organization settings documentation](https://docs.atlas.mongodb.com/tutorial/manage-organization-settings/#require-ip-access-list-for-public-api) for more info.
32
+
In order to set up authentication with the MongoDB Atlas provider a programmatic API key must be generated for MongoDB Atlas with the appropriate permissions and IP access list entries.
33
+
The [MongoDB Atlas documentation](https://docs.atlas.mongodb.com/tutorial/manage-programmatic-access/index.html) contains the most up-to-date instructions for creating and managing your key(s) and IP access.
34
+
Be aware, not all API resources require an IP access list by default, but one can set Atlas to require IP access entries for all API resources, see the [organization settings documentation](https://docs.atlas.mongodb.com/tutorial/manage-organization-settings/#require-ip-access-list-for-public-api) for more info.
33
35
34
36
## Authenticate the Provider
35
37
36
-
The MongoDB Atlas provider offers a flexible means of providing credentials for authentication. The following methods are supported and explained below:
37
-
38
-
### Static credentials
39
-
40
-
Static credentials can be provided by adding the following attributes in-line in the MongoDB Atlas provider block, either directly or via input variable/local value:
41
-
42
-
Usage:
43
-
44
-
```hcl
45
-
provider "mongodbatlas" {
46
-
public_key = "atlas_public_api_key" #required
47
-
private_key = "atlas_private_api_key" #required
48
-
}
49
-
```
50
-
51
-
~> *IMPORTANT* Hard-coding your MongoDB Atlas programmatic API key pair into a Terraform configuration is not recommended. Consider the risks, especially the inadvertent submission of a configuration file containing secrets to a public repository.
38
+
The MongoDB Atlas provider offers a flexible means of providing credentials for authentication.
39
+
You can use any the following methods:
52
40
53
-
### Environment variables
41
+
### Environment Variables
54
42
55
-
You can also provide your credentials via the environment variables, MONGODB_ATLAS_PUBLIC_KEY and MONGODB_ATLAS_PRIVATE_KEY, for your public and private MongoDB Atlas programmatic API key pair respectively:
43
+
You can also provide your credentials via the environment variables,
44
+
`MONGODB_ATLAS_PUBLIC_KEY` and `MONGODB_ATLAS_PRIVATE_KEY`,
45
+
for your public and private MongoDB Atlas programmatic API key pair respectively:
`alias` and `version`), the following arguments are supported in the MongoDB
74
-
Atlas `provider` block:
80
+
In addition to [generic `provider` arguments](https://www.terraform.io/docs/configuration/providers.html)
81
+
(e.g. `alias` and `version`), the MongoDB Atlas `provider` supports the following arguments:
75
82
76
83
*`public_key` - (Optional) This is the public key of your MongoDB Atlas API key pair. It must be
77
-
provided, but it can also be sourced from the `MONGODB_ATLAS_PUBLIC_KEY`
84
+
provided, but it can also be sourced from the `MONGODB_ATLAS_PUBLIC_KEY` or `MCLI_PUBLIC_API_KEY`
78
85
environment variable.
79
86
80
87
*`private_key` - (Optional) This is the private key of your MongoDB Atlas key pair. It must be
81
-
provided, but it can also be sourced from the `MONGODB_ATLAS_PRIVATE_KEY`
88
+
provided, but it can also be sourced from the `MONGODB_ATLAS_PRIVATE_KEY` or `MCLI_PRIVATE_API_KEY`
82
89
environment variable.
83
90
84
91
For more information on configuring and managing programmatic API Keys see the [MongoDB Atlas Documentation](https://docs.atlas.mongodb.com/tutorial/manage-programmatic-access/index.html).
@@ -97,7 +104,10 @@ For more information on configuring and managing programmatic API Keys see the [
97
104
98
105
## Examples from MongoDB and the Community
99
106
100
-
We have [example configurations](https://github.com/mongodb/terraform-provider-mongodbatlas/tree/master/examples) in our GitHub repo that will help both beginner and more advanced users.
107
+
We have [example configurations](https://github.com/mongodb/terraform-provider-mongodbatlas/tree/master/examples)
108
+
in our GitHub repo that will help both beginner and more advanced users.
101
109
102
-
Have a good example you've created and want to share? Let us know the details via an [issue](https://github.com/mongodb/terraform-provider-mongodbatlas/issues) or submit a PR of your work to add it to the examples directory in our [GitHub repo](https://github.com/mongodb/terraform-provider-mongodbatlas/).
110
+
Have a good example you've created and want to share?
111
+
Let us know the details via an [issue](https://github.com/mongodb/terraform-provider-mongodbatlas/issues)
112
+
or submit a PR of your work to add it to the `examples` directory in our [GitHub repo](https://github.com/mongodb/terraform-provider-mongodbatlas/).
0 commit comments