Skip to content

Commit b4a1650

Browse files
martinstibbedependabot[bot]themantissaevertsdandreaangiolillo
authored
Pre-Release staging v1.4.0 (#763)
* INTMDB-310: Potential bug when disabling auditing (#705) * Add support for proper destroy of Auditing settings * Remove whitespace * Add support for schema migration (#717) * Correct import function for snapshot export bucket (#715) * INTMDB-311: Feature Add: Prometheus and Microsoft Team to the Third Party Integration Settings (#706) * INTMDB-311: Feature Add: Promethus and Microsoft Team to the Third Party Integration Settings * Update documentation add additional schema values * Map to temporary branch for testing * Fix Lint * Add boolean field for Prometheus enabled * Remove Name from Teams integration * Remove extra Name field from Teams integration type add examples * Terraform fmt * Correct version * Fix lint issue * terraform fmt example * Update third party integration resource enabled to boolean * Rename example file * Simplify example to integration only Doc updates password optional field * INTMDB-328: Update resource & data source to address change in go SDK that impacts resource_mongodbatlas_x509_authentication_database_user (#738) * Chore(deps): Bump actions/setup-go from 2 to 3 (#710) Bumps [actions/setup-go](https://github.com/actions/setup-go) from 2 to 3. - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](actions/setup-go@v2...v3) --- updated-dependencies: - dependency-name: actions/setup-go dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Chore(deps): Bump github.com/gruntwork-io/terratest (#711) Bumps [github.com/gruntwork-io/terratest](https://github.com/gruntwork-io/terratest) from 0.40.6 to 0.40.7. - [Release notes](https://github.com/gruntwork-io/terratest/releases) - [Commits](gruntwork-io/terratest@v0.40.6...v0.40.7) --- updated-dependencies: - dependency-name: github.com/gruntwork-io/terratest dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Chore(deps): Bump hashicorp/setup-terraform from 1 to 2 (#719) Bumps [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) from 1 to 2. - [Release notes](https://github.com/hashicorp/setup-terraform/releases) - [Changelog](https://github.com/hashicorp/setup-terraform/blob/main/CHANGELOG.md) - [Commits](hashicorp/setup-terraform@v1...v2) --- updated-dependencies: - dependency-name: hashicorp/setup-terraform dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Chore(deps): Bump github.com/hashicorp/terraform-plugin-sdk/v2 (#720) Bumps [github.com/hashicorp/terraform-plugin-sdk/v2](https://github.com/hashicorp/terraform-plugin-sdk) from 2.12.0 to 2.14.0. - [Release notes](https://github.com/hashicorp/terraform-plugin-sdk/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-sdk/blob/main/CHANGELOG.md) - [Commits](hashicorp/terraform-plugin-sdk@v2.12.0...v2.14.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-sdk/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Chore(deps): Bump github.com/hashicorp/terraform-plugin-sdk/v2 (#727) Bumps [github.com/hashicorp/terraform-plugin-sdk/v2](https://github.com/hashicorp/terraform-plugin-sdk) from 2.14.0 to 2.16.0. - [Release notes](https://github.com/hashicorp/terraform-plugin-sdk/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-sdk/blob/main/CHANGELOG.md) - [Commits](hashicorp/terraform-plugin-sdk@v2.14.0...v2.16.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-sdk/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Chore(deps): Bump github.com/gruntwork-io/terratest (#726) Bumps [github.com/gruntwork-io/terratest](https://github.com/gruntwork-io/terratest) from 0.40.7 to 0.40.8. - [Release notes](https://github.com/gruntwork-io/terratest/releases) - [Commits](gruntwork-io/terratest@v0.40.7...v0.40.8) --- updated-dependencies: - dependency-name: github.com/gruntwork-io/terratest dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Chore(deps): Bump github.com/spf13/cast from 1.4.1 to 1.5.0 (#730) Bumps [github.com/spf13/cast](https://github.com/spf13/cast) from 1.4.1 to 1.5.0. - [Release notes](https://github.com/spf13/cast/releases) - [Commits](spf13/cast@v1.4.1...v1.5.0) --- updated-dependencies: - dependency-name: github.com/spf13/cast dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add default empty option list to fix breaking change for X509 certificates library function * Remove empty options := matlas.ListOptions Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * INTMDB-319: Add support for parameter unordered in resource_mongodbatlas_event_trigger (#739) * Add support for unordered realm parameter * Make unordered optional parameter * Update GO SDK to master * Sync to latest SDK library version * Update documentation for unordered parameter * Add support for unordered to tests * Chore(deps): Bump github.com/gruntwork-io/terratest (#744) Bumps [github.com/gruntwork-io/terratest](https://github.com/gruntwork-io/terratest) from 0.40.10 to 0.40.12. - [Release notes](https://github.com/gruntwork-io/terratest/releases) - [Commits](gruntwork-io/terratest@v0.40.10...v0.40.12) --- updated-dependencies: - dependency-name: github.com/gruntwork-io/terratest dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Chore(deps): Bump github.com/hashicorp/terraform-plugin-sdk/v2 (#743) Bumps [github.com/hashicorp/terraform-plugin-sdk/v2](https://github.com/hashicorp/terraform-plugin-sdk) from 2.16.0 to 2.17.0. - [Release notes](https://github.com/hashicorp/terraform-plugin-sdk/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-sdk/blob/main/CHANGELOG.md) - [Commits](hashicorp/terraform-plugin-sdk@v2.16.0...v2.17.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-sdk/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Melissa Plunkett <[email protected]> * INTMDB-321: Add support for cloud export backup to mongodbatlas_cloud_backup_schedule (#740) * Sync to go SDK * Correct lint error * Lint space * Update docs to include auto export and use_org_and_group_names_in_export_prefix * Add link for snapshot export * Rename to emptyStruct * Add brackets to hyperlink * Remove extra space * INTMDB-313: Update the project resource with new settings (#741) * Add support for project_settings * Sync up SDK library latest version * Fix lint isues * Update projects datasource documentation * Update docs with links * Add additional tests for new attributes remove space in import section * Add test for additional project settings * INTMDB-307 Allow setting of regional mode setting on a group (#718) * Started on private_endpoint_regional_mode data_source and resource * Started filling out test and wrote refresh func to ensure cluster status' are all at APPLIED * No longer reading the setting in refresh func * Removed unused testing infrastructure * Fixed data_source test for private endpoint regional mode * Fixed how regional mode refresh func is consumed * Fixed resource name on new test * Added resource and data source to the provider, fixed other build issues * Fixed lint errors * Setting key for private endpoint regional mode as just the projectID * Fixed failing test for private endpoint regional mode. Still need to add a cluster to the config * Added assertion that cluster connection_strings are maintained properly in state * Added example for regional mode and update delay before checking refresh func * Checking if cluster is in the UPDATING state prior to checking against the cluster statsu * Added dependency on regional mode for the cluster data * Updated regional mode example to have usage documentation. Updated integration test to create more of its dependencies during the test * Format example for aws-atlas-privatelink-regionalized * Fixed an issue with tflint * Update regional mode test to spin up vpc requirements * Added documentation and updated example to have two separate private endpoints * Updated example to have regional_mode enabled * Updated Project ID refs in documentation to match others in example tf * Revert "Update regional mode test to spin up vpc requirements" This reverts commit 3f5893c. * Fixed formatting on example tf * Let code breathe in example atlas cluster Co-authored-by: Andrea Angiolillo <[email protected]> * Use proper error and log messaging, utilize diag.Errorf * Update website/docs/r/private_endpoint_regional_mode.html.markdown Co-authored-by: Melissa Plunkett <[email protected]> * Update enabled description in docs to contain more of the api documentation Co-authored-by: Melissa Plunkett <[email protected]> * Update website/docs/r/private_endpoint_regional_mode.html.markdown Co-authored-by: Melissa Plunkett <[email protected]> * Link to registry docs not our github repo Co-authored-by: Melissa Plunkett <[email protected]> * Updated assertions in tests * Updated example to be more current and accurate. Fixed test * Updated private endpoint regional mode to be disabled on delete * Made enabled properly optional for private endpoitn regional mode and made data_source test replicate actual usage Co-authored-by: admin <[email protected]> Co-authored-by: Andrea Angiolillo <[email protected]> Co-authored-by: Melissa Plunkett <[email protected]> * INTDB-301-DOC: Move Federated Docs to separate branch (#747) * Move Federated Docs to separate branch PR * Add docs for new datasources and updated role mappings resource * Refactor okta_idp_id to idp_id in docs * Add additional parameters for identity provider resource * Removed cloud from much of the docs * Applied group id description changes * Addressed more suggested docs changes * Downcased federated settings * Make role mapping import optional add missing formatting for example * Highlight importance of import being needed * Changed Provides an to provides a and remove upper case on federated settings * Update identity_provider datasource * Missed one * Add SHA-256 * Fix post_auth_role_grants * Doc corrections * remove pagination from singular role mapping * Import needed * Doc updates * Update org settings resource to pull up required args * Add import statement importance Co-authored-by: Dosty <[email protected]> * INTMDB-301: Feature add: Add support for managment of federated authentication configuration (#742) * Add support for federated settings * Refactor for service pattern change * Refactor options and plural singular names * Update go SDK version * Add initial federated website docs * Provide examples for Federated settings * Sync go.mod to contain breaking change SDK change * Fix examples for lint error sync SDK to master * Add menu items for federation settings and upgrade guides * Remove Federated Docs from PR * PR Review updates * Add support for datasource tests * Fix lint fmt * Add identity_provider_id variable * Move identity_provider_id * Add role mappings datasource test * Add additional tests for federated resources * Lint check * Add additional datasources and tests * Remove unused function * Add support for role mappings and update tests and examples * Fix role mapping import to fit new style of parameters * Remove commented code * go mod tidy * Remove extra parameter user_conflicts * Add missing parameters and refactor name of variables * Update example * Update mongodbatlas/resource_mongodbatlas_federated_settings_identity_provider.go Co-authored-by: Andrea Angiolillo <[email protected]> * go fmt * Add support for import tests * Add federated settings env variables to README remove upgrade guide * Remove cloud prefix from federated examples and resources idp_id to okta_idp_id * Add new sort to role mapping * Add README for federated example * Refactor alias mongodbatlas to matlas dead code removal import spaces Co-authored-by: Andrea Angiolillo <[email protected]> * Update CHANGELOG.md * Update CHANGELOG.md Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Melissa Plunkett <[email protected]> Co-authored-by: Dosty Everts <[email protected]> Co-authored-by: Andrea Angiolillo <[email protected]>
1 parent 16c9ea8 commit b4a1650

File tree

101 files changed

+6015
-58
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+6015
-58
lines changed

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,30 @@
11
# Changelog
2+
3+
## [v1.4.0-pre.1](https://github.com/mongodb/terraform-provider-mongodbatlas/tree/v1.4.0-pre.1) (2022-06-29)
4+
**Closed issues:**
5+
6+
Fix for Add support for cloud export backup to mongodbatlas_cloud_backup_schedule (#740)
7+
Feature Add: Update the project resource with new settings (#741)
8+
Feature Add: Feature add: Add support for management of federated authentication configuration
9+
Feature Add: Add Regionalized Private Endpoint Settings
10+
Fix for Potential bug when disabling auditing #705
11+
Feature Add: Prometheus and Microsoft Team to the Third Party Integration Settings #706
12+
Fix for Correct import function for snapshot export bucket #714 #715
13+
Fix for Add support for schema migration #717
14+
Feature Add: Prometheus and Microsoft Team to the Third Party Integration Settings
15+
Fix for Cannot import export bucket - bad state id encoding #708
16+
Error missing expected { when updating the provider #697
17+
18+
**Merged pull requests:**
19+
20+
INTMDB-321: Add support for cloud export backup to mongodbatlas_cloud_backup_schedule (#740)
21+
INTMDB-313: Update the project resource with new settings (#741)
22+
INTMDB-301: Feature add: Add support for management of federated authentication configuration
23+
INTMDB-307: Add Regionalized Private Endpoint Settings
24+
INTMDB-310: Potential bug when disabling auditing #705
25+
INTMDB-311: Feature Add: Prometheus and Microsoft Team to the Third Party Integration Settings #706
26+
INTMDB-315: Correct import function for snapshot export bucket #714 #715
27+
INTMDB-309: Add support for schema migration #717
228
## [v1.3.1-pre.1](https://github.com/mongodb/terraform-provider-mongodbatlas/tree/v1.3.1-pre.1) (2022-02-23)
329

430
**Closed issues:**

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,19 @@ $ export MONGODB_ATLAS_API_KEYS_IDS=<API_KEYS_IDS>
141141
export SKIP_TEST_EXTERNAL_CREDENTIALS=TRUE
142142
```
143143

144+
- For `Federated Settings` resource configuration:
145+
```sh
146+
$ export MONGODB_ATLAS_FEDERATION_SETTINGS_ID=<YOUR_FEDERATION_SETTINGS_ID>
147+
$ export ONGODB_ATLAS_FEDERATED_ORG_ID=<YOUR_FEDERATED_ORG_ID>
148+
$ export MONGODB_ATLAS_FEDERATED_PROJECT_ID=<YOUR_VPC_FEDERATED_PROJECT_ID>
149+
$ export MONGODB_ATLAS_FEDERATED_GROUP_ID=<YOUR_FEDERATED_GROUP_ID>
150+
$ export MONGODB_ATLAS_FEDERATED_ROLE_MAPPING_ID=<YOUR_FEDERATED_ROLE_MAPPING_ID>
151+
$ export MONGODB_ATLAS_FEDERATED_OKTA_IDP_ID=<YOUR_FEDERATED_OKTA_IDP_ID>
152+
$ export MONGODB_ATLAS_FEDERATED_SSO_URL=<YOUR_FEDERATED_SSO_URL>
153+
$ export MONGODB_ATLAS_FEDERATED_ISSUER_URI=<YOUR_FEDERATED_ISSUER_URI>
154+
```
155+
~> **Notice:** For more information about the Federation configuration resource, see: https://www.mongodb.com/docs/atlas/reference/api/federation-configuration/
156+
144157
##### AWS env variables
145158

146159
- For `Network Peering` resource configuration:
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Example - Okta and MongoDB Atlas Federated Settings Configuration
2+
3+
This project aims to provide an example of using Okta and MongoDB Atlas together.
4+
5+
6+
## Dependencies
7+
8+
* Terraform v0.13
9+
* Okta account
10+
* A MongoDB Atlas account
11+
12+
```
13+
Terraform v0.13.0
14+
+ provider registry.terraform.io/terraform-providers/mongodbatlas v1.4.0
15+
```
16+
17+
## Usage
18+
19+
**1\. Ensure your Okta/Mongodb Atlas Federal settings configuration is set up to have a working set of organizations, verified domains, and identity providers.**
20+
21+
**2\. TFVARS**
22+
23+
Now create **terraform.tfvars** file with all the variable values and make sure **not to commit it**.
24+
25+
**3\. Review the Terraform plan. **
26+
27+
Execute the below command and ensure you are happy with the plan.
28+
29+
``` bash
30+
$ terraform plan
31+
```
32+
This project currently does the below deployments:
33+
34+
- MongoDB Atlas Federated Settings Organizational Role Mapping
35+
- MongoDB Atlas Federated Settings Organizational Identity Provider
36+
- MongoDB Atlas Federated Settings Organizational configuration
37+
38+
**4\. Execute the Terraform import for 2 resources that do not support create.**
39+
``` bash
40+
$ terraform import mongodbatlas_federated_settings_identity_provider.identity_provider 6287a67f7f7f7f7f441c6c-0oad7f7f7f7fk1297
41+
terraform import mongodbatlas_federated_settings_org_config.org_connections_import 6287a67f7f7f7f7f441c6c-627a96837f7f7f7f7e306f14
42+
43+
```
44+
45+
**5\. Execute the Terraform apply.**
46+
47+
Now execute the plan to provision the Federated settings resources.
48+
49+
``` bash
50+
$ terraform apply
51+
```
52+
53+
**6\. Destroy the resources.**
54+
55+
Once you are finished your testing, ensure you destroy the resources to avoid unnecessary Atlas charges.
56+
57+
``` bash
58+
$ terraform destroy
59+
```
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
data "mongodbatlas_federated_settings" "federated_settings" {
2+
org_id = var.org_id
3+
}
4+
data "mongodbatlas_federated_settings_identity_providers" "identity_provider" {
5+
federation_settings_id = data.mongodbatlas_federated_settings.federated_settings.id
6+
}
7+
8+
data "mongodbatlas_federated_settings_org_configs" "org_configs_ds" {
9+
federation_settings_id = data.mongodbatlas_federated_settings.federated_settings.id
10+
}
11+
12+
data "mongodbatlas_federated_settings_org_role_mappings" "org_role_mapping" {
13+
federation_settings_id = data.mongodbatlas_federated_settings.federated_settings.id
14+
org_id = var.org_id
15+
}
16+
resource "mongodbatlas_federated_settings_org_role_mapping" "org_role_mapping" {
17+
federation_settings_id = data.mongodbatlas_federated_settings.federated_settings.id
18+
org_id = var.org_id
19+
external_group_name = "newgroup"
20+
21+
role_assignments {
22+
group_id = var.group_id
23+
roles = ["GROUP_OWNER", "GROUP_DATA_ACCESS_ADMIN", "GROUP_SEARCH_INDEX_EDITOR", "GROUP_DATA_ACCESS_READ_ONLY"]
24+
}
25+
26+
role_assignments {
27+
org_id = var.org_id
28+
roles = ["ORG_OWNER", "ORG_MEMBER"]
29+
}
30+
31+
}
32+
resource "mongodbatlas_federated_settings_org_config" "org_connections_import" {
33+
federation_settings_id = data.mongodbatlas_federated_settings.federated_settings.id
34+
org_id = var.org_id
35+
identity_provider_id = var.identity_provider_id
36+
domain_restriction_enabled = false
37+
domain_allow_list = ["yourdomain.com"]
38+
}
39+
40+
resource "mongodbatlas_federated_settings_identity_provider" "identity_provider" {
41+
federation_settings_id = data.mongodbatlas_federated_settings.federated_settings.id
42+
name = var.name
43+
associated_domains = ["yourdomain.com"]
44+
sso_debug_enabled = true
45+
status = "ACTIVE"
46+
sso_url = "https://mysso.oktapreview.com/app/mysso_terrafssotesdev_1/exk1f7f7f7fk5wp50h8/sso/saml"
47+
issuer_uri = "http://www.okta.com/exk1f716hf7f750h8"
48+
request_binding = "HTTP-POST"
49+
response_signature_algorithm = "SHA-256"
50+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
output "federated_settings_ds" {
2+
value = data.mongodbatlas_federated_settings.federated_settings.id
3+
}
4+
5+
output "identity_provider" {
6+
value = data.mongodbatlas_federated_settings_identity_providers.identity_provider.id
7+
}
8+
9+
output "org_configs_ds" {
10+
value = data.mongodbatlas_federated_settings_org_configs.org_configs_ds.id
11+
}
12+
13+
output "org_role_mapping" {
14+
value = data.mongodbatlas_federated_settings_org_role_mappings.org_role_mapping.id
15+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
provider "mongodbatlas" {
2+
public_key = var.public_key
3+
private_key = var.private_key
4+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
variable "public_key" {
2+
type = string
3+
description = "Public Programmatic API key to authenticate to Atlas"
4+
}
5+
variable "private_key" {
6+
type = string
7+
description = "Private Programmatic API key to authenticate to Atlas"
8+
}
9+
variable "org_id" {
10+
type = string
11+
description = "MongoDB Organization ID"
12+
}
13+
variable "group_id" {
14+
type = string
15+
description = "MongoDB Group ID"
16+
}
17+
18+
variable "name" {
19+
type = string
20+
description = "MongoDB Identity Provider Name"
21+
default = "mongodb_federation_test"
22+
}
23+
24+
variable "identity_provider_id" {
25+
type = string
26+
description = "MongoDB Identity Provider ID"
27+
default = "5754gdhgd758"
28+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
terraform {
2+
required_providers {
3+
azurerm = {
4+
source = "hashicorp/azurerm"
5+
}
6+
mongodbatlas = {
7+
source = "mongodb/mongodbatlas"
8+
}
9+
}
10+
required_version = ">= 0.13"
11+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
iatlaspl.code-workspace
2+
terraform.tfvars
3+
.terraform/
4+
*.tfstate*
5+
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Example - A basic example configuring MongoDB Atlas Third Party Integrations and Terraform
2+
3+
This project aims to provide a very straight-forward example of setting up Terraform with MongoDB Atlas. This will create the following resources in MongoDB Atlas:
4+
5+
- Atlas Project
6+
- Microst Teams Third Party Integration
7+
- Prometheus Third Party Integration
8+
9+
10+
You can refer to the MongoDB Atlas documentation to know about the parameters that support Third Party Integrations.
11+
12+
[Prometheus](https://www.mongodb.com/docs/atlas/tutorial/prometheus-integration/#std-label-httpsd-prometheus-config)
13+
14+
[Microsoft Teams](https://www.mongodb.com/docs/atlas/tutorial/integrate-msft-teams/)
15+
16+
## Dependencies
17+
18+
* Terraform v0.13 or greater
19+
* A MongoDB Atlas account
20+
* provider.mongodbatlas: version = "~> 0.9.1"
21+
22+
## Usage
23+
24+
**1\. Ensure your MongoDB Atlas credentials are set up.**
25+
26+
This can be done using environment variables:
27+
28+
```bash
29+
export MONGODB_ATLAS_PUBLIC_KEY="xxxx"
30+
export MONGODB_ATLAS_PRIVATE_KEY="xxxx"
31+
```
32+
33+
... or follow as in the `variables.tf` file and create **terraform.tfvars** file with all the variable values and make sure **not to commit it**.
34+
35+
36+
> **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.
37+
38+
39+
**2\. Review the Terraform plan.**
40+
41+
Execute the below command and ensure you are happy with the plan.
42+
43+
``` bash
44+
$ terraform plan
45+
```
46+
47+
This project currently creates the below deployments:
48+
49+
- Atlas Project
50+
- Microst Teams Third Party Integration
51+
- Prometheus Third Party Integration
52+
53+
**3\. Execute the Terraform apply.**
54+
55+
Now execute the plan to provision the MongoDB Atlas resources.
56+
57+
``` bash
58+
$ terraform apply
59+
```
60+
61+
**4\. Destroy the resources.**
62+
63+
Once you are finished your testing, ensure you destroy the resources to avoid unnecessary charges.
64+
65+
``` bash
66+
$ terraform destroy
67+
```
68+

0 commit comments

Comments
 (0)