Skip to content

Commit 959f474

Browse files
committed
Merge branch 'CLOUDP-320243-dev-2.0.0' into CLOUDP-332657_lro_network_peering
* CLOUDP-320243-dev-2.0.0: fix: Changes `actions` attribute to TypeSet in `mongodbatlas_custom_db_role` to not be sensitive to order (#3508) chore: Updates CHANGELOG.md for #3513 fix: Sets org_id on import of `mongodbatlas_organization` resource (#3513) go 1.24.5 (#3514) chore: Updates CHANGELOG.md for #3484 feat: Add azure attributes in federated database instance resource (#3484) chore: Updates CHANGELOG.md for #3505 feat: Add support for `MONGODB_ATLAS_PUBLIC_API_KEY` and `MONGODB_ATLAS_PRIVATE_API_KEY` to TF (#3505)
2 parents d90d740 + cc7b67e commit 959f474

25 files changed

+409
-191
lines changed

.changelog/3484.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
```release-note:enhancement
2+
resource/mongodbatlas_federated_database_instance: Adds `azure` attribute to allow the creation of federated databases with Azure cloud provider configuration
3+
```
4+
5+
```release-note:enhancement
6+
data-source/mongodbatlas_federated_database_instance: Adds `azure` attribute to support reading federated databases with Azure cloud provider configuration
7+
```
8+
9+
```release-note:enhancement
10+
data-source/mongodbatlas_federated_database_instances: Adds `azure` attribute to support reading federated databases with Azure cloud provider configuration
11+
```

.changelog/3505.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:note
2+
New environment variables: We added support for the `MONGODB_ATLAS_PUBLIC_API_KEY` and `MONGODB_ATLAS_PRIVATE_API_KEY` environment variables which are widely used across the MongoDB ecosystem.
3+
```

.changelog/3508.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:breaking-change
2+
resource/mongodbatlas_custom_db_role: Changes actions attribute to not be sensitive to order
3+
```

.changelog/3513.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:bug
2+
resource/mongodbatlas_organization: Sets org_id on import
3+
```

.github/workflows/acceptance-tests-runner.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -800,6 +800,9 @@ jobs:
800800
MONGODB_ATLAS_FEDERATED_ISSUER_URI: ${{ inputs.mongodb_atlas_federated_issuer_uri }}
801801
MONGODB_ATLAS_FEDERATED_ORG_ID: ${{ inputs.mongodb_atlas_federated_org_id }}
802802
MONGODB_ATLAS_FEDERATED_SETTINGS_ASSOCIATED_DOMAIN: ${{ inputs.mongodb_atlas_federated_settings_associated_domain }}
803+
AZURE_ATLAS_APP_ID: ${{ inputs.azure_atlas_app_id }}
804+
AZURE_SERVICE_PRINCIPAL_ID: ${{ inputs.azure_service_principal_id }}
805+
AZURE_TENANT_ID: ${{ inputs.azure_tenant_id }}
803806
AWS_S3_BUCKET: ${{ secrets.aws_s3_bucket_federation }}
804807
AWS_REGION: ${{ inputs.aws_region_federation }}
805808
AWS_ACCESS_KEY_ID: ${{ secrets.aws_access_key_id }}

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
## (Unreleased)
22

3+
NOTES:
4+
5+
* New environment variables: We added support for the `MONGODB_ATLAS_PUBLIC_API_KEY` and `MONGODB_ATLAS_PRIVATE_API_KEY` environment variables which are widely used across the MongoDB ecosystem. ([#3505](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/3505))
6+
7+
ENHANCEMENTS:
8+
9+
* data-source/mongodbatlas_federated_database_instance: Adds `azure` attribute to support reading federated databases with Azure cloud provider configuration ([#3484](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/3484))
10+
* data-source/mongodbatlas_federated_database_instances: Adds `azure` attribute to support reading federated databases with Azure cloud provider configuration ([#3484](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/3484))
11+
* resource/mongodbatlas_federated_database_instance: Adds `azure` attribute to allow the creation of federated databases with Azure cloud provider configuration ([#3484](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/3484))
12+
13+
BUG FIXES:
14+
15+
* resource/mongodbatlas_organization: Sets org_id on import ([#3513](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/3513))
16+
317
## 1.38.0 (July 10, 2025)
418

519
NOTES:

docs/index.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ You can use any the following methods:
4949
### Environment Variables
5050

5151
You can also provide your credentials via the environment variables,
52-
`MONGODB_ATLAS_PUBLIC_KEY` and `MONGODB_ATLAS_PRIVATE_KEY`,
52+
`MONGODB_ATLAS_PUBLIC_API_KEY` and `MONGODB_ATLAS_PRIVATE_API_KEY`,
5353
for your public and private MongoDB Atlas programmatic API key pair respectively:
5454

5555
```terraform
@@ -59,14 +59,13 @@ provider "mongodbatlas" {}
5959
Usage (prefix the export commands with a space to avoid the keys being recorded in OS history):
6060

6161
```shell
62-
$ export MONGODB_ATLAS_PUBLIC_KEY="<ATLAS_PUBLIC_KEY>"
63-
$ export MONGODB_ATLAS_PRIVATE_KEY="<ATLAS_PRIVATE_KEY>"
62+
$ export MONGODB_ATLAS_PUBLIC_API_KEY="<ATLAS_PUBLIC_KEY>"
63+
$ export MONGODB_ATLAS_PRIVATE_API_KEY="<ATLAS_PRIVATE_KEY>"
6464
$ terraform plan
6565
```
6666

67-
As an alternative to `MONGODB_ATLAS_PUBLIC_KEY` and `MONGODB_ATLAS_PRIVATE_KEY`
68-
if you are using [MongoDB CLI](https://docs.mongodb.com/mongocli/stable/)
69-
then `MCLI_PUBLIC_API_KEY` and `MCLI_PRIVATE_API_KEY` are also supported.
67+
We recommend that you use the `MONGODB_ATLAS_PUBLIC_API_KEY` and `MONGODB_ATLAS_PRIVATE_API_KEY` environment variables because they are compatible with other MongoDB tools, such as Atlas CLI.
68+
You can still use `MONGODB_ATLAS_PUBLIC_KEY` and `MONGODB_ATLAS_PRIVATE_KEY` as alternative keys in your local environment. However, these environment variables are not guaranteed to work across all tools in the MongoDB ecosystem.
7069

7170
### AWS Secrets Manager
7271
AWS Secrets Manager (AWS SM) helps to manage, retrieve, and rotate database credentials, API keys, and other secrets throughout their lifecycles. See [product page](https://aws.amazon.com/secrets-manager/) and [documentation](https://docs.aws.amazon.com/systems-manager/latest/userguide/what-is-systems-manager.html) for more details.

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/mongodb/terraform-provider-mongodbatlas
22

3-
go 1.24.4
3+
go 1.24.5
44

55
require (
66
github.com/andygrunwald/go-jira/v2 v2.0.0-20240116150243-50d59fe116d6

internal/provider/provider.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,7 @@ func setDefaultValuesWithValidations(ctx context.Context, data *tfMongodbAtlasPr
353353

354354
if data.PublicKey.ValueString() == "" {
355355
data.PublicKey = types.StringValue(MultiEnvDefaultFunc([]string{
356+
"MONGODB_ATLAS_PUBLIC_API_KEY",
356357
"MONGODB_ATLAS_PUBLIC_KEY",
357358
"MCLI_PUBLIC_API_KEY",
358359
}, "").(string))
@@ -363,6 +364,7 @@ func setDefaultValuesWithValidations(ctx context.Context, data *tfMongodbAtlasPr
363364

364365
if data.PrivateKey.ValueString() == "" {
365366
data.PrivateKey = types.StringValue(MultiEnvDefaultFunc([]string{
367+
"MONGODB_ATLAS_PRIVATE_API_KEY",
366368
"MONGODB_ATLAS_PRIVATE_KEY",
367369
"MCLI_PRIVATE_API_KEY",
368370
}, "").(string))

internal/provider/provider_sdk2.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@ func setDefaultsAndValidations(d *schema.ResourceData) diag.Diagnostics {
351351
}
352352

353353
if err := setValueFromConfigOrEnv(d, "public_key", []string{
354+
"MONGODB_ATLAS_PUBLIC_API_KEY",
354355
"MONGODB_ATLAS_PUBLIC_KEY",
355356
"MCLI_PUBLIC_API_KEY",
356357
}); err != nil {
@@ -361,6 +362,7 @@ func setDefaultsAndValidations(d *schema.ResourceData) diag.Diagnostics {
361362
}
362363

363364
if err := setValueFromConfigOrEnv(d, "private_key", []string{
365+
"MONGODB_ATLAS_PRIVATE_API_KEY",
364366
"MONGODB_ATLAS_PRIVATE_KEY",
365367
"MCLI_PRIVATE_API_KEY",
366368
}); err != nil {

0 commit comments

Comments
 (0)