Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Bring latest changes from master into dev branch (includes adopting latest stable SDK version) #2491

Merged
merged 85 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
bfc18aa
doc: Updates `mongodbatlas_global_cluster_config` doc about self-mana…
lantoli Jun 27, 2024
78e6eba
test: Unifies Azure and GCP networking tests (#2371)
lantoli Jun 27, 2024
c647bf2
chore: Updates examples link in index.html.markdown for v1.17.3 release
svc-apix-Bot Jun 27, 2024
1fad9f4
chore: Updates CHANGELOG.md header for v1.17.3 release
svc-apix-Bot Jun 27, 2024
45bc5e5
doc: Updates Terraform Compatibility Matrix documentation (#2370)
svc-apix-Bot Jul 1, 2024
7068f36
use ComposeAggregateTestCheckFunc (#2375)
lantoli Jul 1, 2024
27ca92a
chore: Updates asdf to TF 1.9.0 and compatibility matrix body (#2376)
lantoli Jul 1, 2024
ac3f1fd
fix: stale.yaml gh action (#2379)
andreaangiolillo Jul 1, 2024
31d4381
doc: Updates alert-config examples (#2378)
EspenAlbert Jul 2, 2024
f2078c5
chore: Updates Atlas Go SDK (#2380)
svc-apix-Bot Jul 2, 2024
2b82c1a
chore: Bump github.com/aws/aws-sdk-go from 1.54.8 to 1.54.13 (#2383)
dependabot[bot] Jul 3, 2024
15143f0
chore: Bump amannn/action-semantic-pull-request from 5.5.2 to 5.5.3 (…
dependabot[bot] Jul 3, 2024
d6ac0c8
test: Improves tests for mongodbatlas_search_index (#2384)
lantoli Jul 3, 2024
789f38a
chore: Updates nightly tests to TF 1.9.x (#2386)
lantoli Jul 3, 2024
5dffb29
fix: Emptying cloud_back_schedule "copy_settings" (#2387)
EspenAlbert Jul 4, 2024
7de7e64
chore: Updates CHANGELOG.md for #2387
svc-apix-Bot Jul 4, 2024
2288b94
chore: Updates delete logic for `mongodbatlas_search_deployment` (#2389)
lantoli Jul 4, 2024
76ffb69
refactor: use advanced_cluster instead of cluster (#2392)
EspenAlbert Jul 9, 2024
249a523
fix: Returns error if the analyzers attribute contains unknown fields…
marcosuma Jul 9, 2024
4377ba1
chore: Updates CHANGELOG.md for #2394
svc-apix-Bot Jul 9, 2024
b6cdcbf
chore: Bump github.com/aws/aws-sdk-go from 1.54.13 to 1.54.17 (#2401)
dependabot[bot] Jul 10, 2024
5b551d7
chore: Bump github.com/hashicorp/terraform-plugin-testing (#2400)
dependabot[bot] Jul 10, 2024
6e8a5cd
chore: Bump github.com/hashicorp/terraform-plugin-framework (#2398)
dependabot[bot] Jul 10, 2024
4bc8a07
chore: Bump github.com/hashicorp/terraform-plugin-framework-validator…
dependabot[bot] Jul 10, 2024
ec5424b
test: Uses hclwrite to generate the cluster for GetClusterInfo (#2404)
EspenAlbert Jul 11, 2024
9f78a9e
fix: Fixes `disk_iops` attribute for Azure cloud provider in `mongodb…
lantoli Jul 11, 2024
93733ef
chore: Updates CHANGELOG.md for #2396
svc-apix-Bot Jul 11, 2024
dd7d62b
test: Refactors `mongodbatlas_private_endpoint_regional_mode` to use …
EspenAlbert Jul 12, 2024
c5c5bd7
test: Refactors resource tests to use GetClusterInfo `online_archive`…
EspenAlbert Jul 12, 2024
c2b384b
update .tool-versions (#2417)
lantoli Jul 12, 2024
749292c
feat: Adds `stored_source` attribute to `mongodbatlas_search_index` r…
lantoli Jul 14, 2024
011e6a2
chore: Updates CHANGELOG.md for #2388
svc-apix-Bot Jul 14, 2024
d0c7113
doc: Improves Guides menu (#2408)
lantoli Jul 15, 2024
e2b3a96
test: Refactors resource tests to use GetClusterInfo `ldap_configurat…
EspenAlbert Jul 15, 2024
4c9c392
test: Refactors resource tests to use GetClusterInfo `cloud_backup_sn…
EspenAlbert Jul 15, 2024
c1cb5fd
doc: Clarify usage of maintenance window resource (#2418)
AgustinBettati Jul 15, 2024
3110a52
test: Refactors resource tests to use GetClusterInfo `cloud_backup_sc…
EspenAlbert Jul 15, 2024
6674f82
test: Refactors resource tests to use GetClusterInfo `federated_datab…
EspenAlbert Jul 15, 2024
d1c25f0
doc: Removes docs headers as they are not needed (#2422)
lantoli Jul 15, 2024
35e2a87
test: Refactors resource tests to use GetClusterInfo `backup_complian…
EspenAlbert Jul 16, 2024
3f45cca
test: Refactors resource tests to use GetClusterInfo `cluster_outage_…
EspenAlbert Jul 16, 2024
f9a1809
test: Fixes DUPLICATE_CLUSTER_NAME failures (#2424)
EspenAlbert Jul 16, 2024
fa31ccf
test: Refactors GetClusterInfo (#2426)
EspenAlbert Jul 16, 2024
4e3144c
doc: Updates to new Terraform doc structure (#2425)
lantoli Jul 16, 2024
87ca68d
chore: Bump github.com/zclconf/go-cty from 1.14.4 to 1.15.0 (#2433)
dependabot[bot] Jul 17, 2024
b83c28e
chore: Bump github.com/aws/aws-sdk-go from 1.54.17 to 1.54.19 (#2432)
dependabot[bot] Jul 17, 2024
626a83b
chore: Bump actions/setup-go from 5.0.1 to 5.0.2 (#2431)
dependabot[bot] Jul 17, 2024
fae643d
chore: Bump tj-actions/verify-changed-files (#2430)
dependabot[bot] Jul 17, 2024
bd01af7
refactor: avoid usage of github.com/go-test/deep (use `reflect.DeepEq…
EspenAlbert Jul 17, 2024
214b694
chore: Deletes modules folder (#2435)
lantoli Jul 17, 2024
de0ab51
chore: Makes sure doc generation is up-to-date (#2441)
lantoli Jul 18, 2024
9d5c3ee
chore: Enables GitHub Action linter errors in GitHub (#2440)
lantoli Jul 18, 2024
b4b9109
update version (#2439)
lantoli Jul 18, 2024
5cad7be
doc: Updates examples & docs that use replicaSet clusters (#2428)
lantoli Jul 18, 2024
81ff1eb
fix MongoDB_Atlas (#2445)
lantoli Jul 18, 2024
0163858
chore: Updates examples link in index.md for v1.17.4 release
svc-apix-Bot Jul 19, 2024
b6a562a
chore: Updates CHANGELOG.md header for v1.17.4 release
svc-apix-Bot Jul 19, 2024
27ce0b1
chore: Migrates `mongodbatlas_cloud_backup_snapshot_export_job` to ne…
oarbusi Jul 19, 2024
3de3793
chore: Migrates `mongodbatlas_project_api_key` to new auto-generated …
oarbusi Jul 19, 2024
5578f16
chore: Removes usage of old Admin SDK in tests (#2442)
oarbusi Jul 19, 2024
85d08fc
chore: Updates CHANGELOG.md for #2436
svc-apix-Bot Jul 19, 2024
9831293
chore: Clean up usages of old SDK (#2449)
oarbusi Jul 23, 2024
12433b7
allow 0 (#2456)
lantoli Jul 23, 2024
80dcc2d
fix: Fixes creation of organization (#2462)
oarbusi Jul 29, 2024
7d35739
chore: Updates CHANGELOG.md for #2462
svc-apix-Bot Jul 29, 2024
7fdbae1
fix: Fixes nil pointer dereference in `mongodbatlas_alert_configurati…
oarbusi Jul 30, 2024
8fdf420
chore: Updates CHANGELOG.md for #2463
svc-apix-Bot Jul 30, 2024
b6dadfb
chore: Updates examples link in index.md for v1.17.5 release
svc-apix-Bot Jul 30, 2024
2fe6306
chore: Updates CHANGELOG.md header for v1.17.5 release
svc-apix-Bot Jul 30, 2024
8487a3d
chore: Bump golangci/golangci-lint-action from 6.0.1 to 6.1.0 (#2469)
dependabot[bot] Jul 31, 2024
94371a9
chore: Bump github.com/aws/aws-sdk-go from 1.54.19 to 1.55.5 (#2468)
dependabot[bot] Jul 31, 2024
99e9212
fix: Handles update of `mongodbatlas_backup_compliance_policy` as a c…
oarbusi Aug 7, 2024
8b07220
chore: Updates CHANGELOG.md for #2480
svc-apix-Bot Aug 7, 2024
f9fea40
chore: Updates examples link in index.md for v1.17.6 release
svc-apix-Bot Aug 7, 2024
df074de
chore: Updates CHANGELOG.md header for v1.17.6 release
svc-apix-Bot Aug 7, 2024
f2c7835
feat: Adds azure support for backup snapshot export bucket (#2486)
oarbusi Aug 8, 2024
40a3b9f
chore: Updates CHANGELOG.md for #2486
svc-apix-Bot Aug 8, 2024
2059bf6
chore: Improves backup_compliance_policy test(#2484)
oarbusi Aug 9, 2024
5f715ab
chore: Updates Atlas Go SDK to version 2024-08-05 (#2487)
AgustinBettati Aug 9, 2024
f045058
Merge remote-tracking branch 'origin/master' into CLOUDP-266563
AgustinBettati Aug 9, 2024
1065d78
manual fixes of versions in advanced cluster, cloud backup schedule, …
AgustinBettati Aug 11, 2024
f647db4
fix incorrect merging in cloud backup schedule tests
AgustinBettati Aug 11, 2024
c54da61
using connV2 for import in advanced cluster
AgustinBettati Aug 11, 2024
edb8fbb
use lastest sdk model for tests that require autoscaling model
AgustinBettati Aug 11, 2024
e4a5c2d
avoid using old SDK for delete operation
AgustinBettati Aug 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .changelog/2436.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
```release-note:note
resource/mongodbatlas_cloud_backup_snapshot_export_job: Deprecates the `err_msg` attribute
```

```release-note:note
data-source/mongodbatlas_cloud_backup_snapshot_export_job: Deprecates the `err_msg` attribute
```

```release-note:note
data-source/mongodbatlas_cloud_backup_snapshot_export_jobs: Deprecates the `err_msg` attribute
```
3 changes: 3 additions & 0 deletions .changelog/2462.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
resource/mongodbatlas_organization: Fixes a bug in organization resource creation where the provider crashed
```
3 changes: 3 additions & 0 deletions .changelog/2463.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
resource/mongodbatlas_alert_configuration: Fixes an issue where the `terraform apply` command crashes if you attempt to edit an existing `mongodbatlas_alert_configuration` by adding a value to `threshold_config`
```
3 changes: 3 additions & 0 deletions .changelog/2480.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
resource/mongodbatlas_backup_compliance_policy: Fixes an issue where the update operation modified attributes that were not supposed to be modified"
```
11 changes: 11 additions & 0 deletions .changelog/2486.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
```release-note:enhancement
data-source/mongodbatlas_cloud_backup_snapshot_export_bucket: Adds Azure support
```

```release-note:enhancement
resource/mongodbatlas_cloud_backup_snapshot_export_bucket: Adds Azure support
```

```release-note:enhancement
data-source/mongodbatlas_cloud_backup_snapshot_export_buckets: Adds Azure support
```
9 changes: 9 additions & 0 deletions .github/workflows/acceptance-tests-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ on:
required: true
aws_s3_bucket_backup:
required: true
azure_service_url_backup:
required: true
azure_blob_storage_container_backup:
required: true
mongodb_atlas_ldap_hostname:
required: true
mongodb_atlas_ldap_username:
Expand Down Expand Up @@ -364,6 +368,11 @@ jobs:
AWS_SECRET_ACCESS_KEY: ${{ secrets.aws_secret_access_key }}
AWS_ACCESS_KEY_ID: ${{ secrets.aws_access_key_id }}
AWS_S3_BUCKET: ${{ secrets.aws_s3_bucket_backup }}
AZURE_BLOB_STORAGE_CONTAINER_NAME: ${{ secrets.azure_blob_storage_container_backup }}
AZURE_SERVICE_URL: ${{ secrets.azure_service_url_backup }}
AZURE_ATLAS_APP_ID: ${{ inputs.azure_atlas_app_id }}
AZURE_SERVICE_PRINCIPAL_ID: ${{ inputs.azure_service_principal_id }}
AZURE_TENANT_ID: ${{ inputs.azure_tenant_id }}
ACCTEST_PACKAGES: |
./internal/service/cloudbackupschedule
./internal/service/cloudbackupsnapshot
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/acceptance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ jobs:
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws_s3_bucket_federation: ${{ secrets.AWS_S3_BUCKET_FEDERATION }}
aws_s3_bucket_backup: ${{ secrets.AWS_S3_BUCKET_BACKUP }}
azure_service_url_backup: ${{ secrets.AZURE_SERVICE_URL_BACKUP }}
azure_blob_storage_container_backup: ${{ secrets.AZURE_BLOB_STORAGE_CONTAINER_BACKUP }}
mongodb_atlas_ldap_hostname: ${{ secrets.MONGODB_ATLAS_LDAP_HOSTNAME }}
mongodb_atlas_ldap_username: ${{ secrets.MONGODB_ATLAS_LDAP_USERNAME }}
mongodb_atlas_ldap_password: ${{ secrets.MONGODB_ATLAS_LDAP_PASSWORD }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code-health.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
go-version-file: 'go.mod'
cache: false # see https://github.com/golangci/golangci-lint-action/issues/807
- name: golangci-lint
uses: golangci/golangci-lint-action@a4f60bb28d35aeee14e6880718e0c85ff1882e64
uses: golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86
with:
version: v1.59.1 # Also update GOLANGCI_VERSION variable in GNUmakefile when updating this version
- name: actionlint
Expand Down
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,33 @@

ENHANCEMENTS:

* data-source/mongodbatlas_cloud_backup_snapshot_export_bucket: Adds Azure support ([#2486](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2486))
* data-source/mongodbatlas_cloud_backup_snapshot_export_buckets: Adds Azure support ([#2486](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2486))
* resource/mongodbatlas_cloud_backup_snapshot_export_bucket: Adds Azure support ([#2486](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2486))

## 1.17.6 (August 07, 2024)

BUG FIXES:

* resource/mongodbatlas_backup_compliance_policy: Fixes an issue where the update operation modified attributes that were not supposed to be modified" ([#2480](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2480))

## 1.17.5 (July 30, 2024)

NOTES:

* data-source/mongodbatlas_cloud_backup_snapshot_export_job: Deprecates the `err_msg` attribute ([#2436](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2436))
* data-source/mongodbatlas_cloud_backup_snapshot_export_jobs: Deprecates the `err_msg` attribute ([#2436](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2436))
* resource/mongodbatlas_cloud_backup_snapshot_export_job: Deprecates the `err_msg` attribute ([#2436](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2436))

BUG FIXES:

* resource/mongodbatlas_alert_configuration: Fixes an issue where the `terraform apply` command crashes if you attempt to edit an existing `mongodbatlas_alert_configuration` by adding a value to `threshold_config` ([#2463](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2463))
* resource/mongodbatlas_organization: Fixes a bug in organization resource creation where the provider crashed ([#2462](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2462))

## 1.17.4 (July 19, 2024)

ENHANCEMENTS:

* data-source/mongodbatlas_search_index: Adds attribute `stored_source` ([#2388](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2388))
* data-source/mongodbatlas_search_indexes: Adds attribute `stored_source` ([#2388](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2388))
* resource/mongodbatlas_search_index: Adds attribute `stored_source` ([#2388](https://github.com/mongodb/terraform-provider-mongodbatlas/pull/2388))
Expand Down
10 changes: 7 additions & 3 deletions docs/data-sources/cloud_backup_snapshot_export_bucket.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,13 @@ data "mongodbatlas_cloud_backup_snapshot_export_bucket" "test" {

In addition to all arguments above, the following attributes are exported:

* `iam_role_id` - Unique identifier of the role that Atlas can use to access the bucket. You must also specify the `bucket_name`.
* `bucket_name` - Name of the bucket that the provided role ID is authorized to access. You must also specify the `iam_role_id`.
* `cloud_provider` - Name of the provider of the cloud service where Atlas can access the S3 bucket. Atlas only supports `AWS`.
* `iam_role_id` - Unique identifier of the role that Atlas can use to access the bucket.
* `bucket_name` - Name of the bucket that the provided role ID is authorized to access.
* `cloud_provider` - Name of the provider of the cloud service where Atlas can access the S3 bucket.
* `role_id` - Unique identifier of the Azure Service Principal that Atlas can use to access the Azure Blob Storage Container.
* `service_url` - URL that identifies the blob Endpoint of the Azure Blob Storage Account.
* `tenant_id` - UUID that identifies the Azure Active Directory Tenant ID.




Expand Down
9 changes: 6 additions & 3 deletions docs/data-sources/cloud_backup_snapshot_export_buckets.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,12 @@ In addition to all arguments above, the following attributes are exported:
### CloudProviderSnapshotExportBucket
* `project_id` - The unique identifier of the project for the Atlas cluster.
* `export_bucket_id` - Unique identifier of the snapshot bucket id.
* `iam_role_id` - Unique identifier of the role that Atlas can use to access the bucket. You must also specify the `bucket_name`.
* `bucket_name` - Name of the bucket that the provided role ID is authorized to access. You must also specify the `iam_role_id`.
* `cloud_provider` - Name of the provider of the cloud service where Atlas can access the S3 bucket. Atlas only supports `AWS`.
* `iam_role_id` - Unique identifier of the role that Atlas can use to access the bucket.
* `bucket_name` - Name of the bucket that the provided role ID is authorized to access.
* `cloud_provider` - Name of the provider of the cloud service where Atlas can access the S3 bucket.
* `role_id` - Unique identifier of the Azure Service Principal that Atlas can use to access the Azure Blob Storage Container.
* `service_url` - URL that identifies the blob Endpoint of the Azure Blob Storage Account.
* `tenant_id` - UUID that identifies the Azure Active Directory Tenant ID.


For more information see: [MongoDB Atlas API Reference.](https://docs.atlas.mongodb.com/reference/api/cloud-backup/export/create-one-export-bucket/)
2 changes: 1 addition & 1 deletion docs/data-sources/cloud_backup_snapshot_export_job.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ In addition to all arguments above, the following attributes are exported:
* `custom_data` - Custom data to include in the metadata file named `.complete` that Atlas uploads to the bucket when the export job finishes. Custom data can be specified as key and value pairs.
* `components` - _Returned for sharded clusters only._ Export job details for each replica set in the sharded cluster.
* `created_at` - Timestamp in ISO 8601 date and time format in UTC when the export job was created.
* `err_msg` - Error message, only if the export job failed.
* `err_msg` - Error message, only if the export job failed. **Note:** This attribute is deprecated as it is not being used.
* `export_status` - _Returned for replica set only._ Status of the export job.
* `finished_at` - Timestamp in ISO 8601 date and time format in UTC when the export job completes.
* `export_job_id` - Unique identifier of the export job.
Expand Down
2 changes: 1 addition & 1 deletion docs/data-sources/cloud_backup_snapshot_export_jobs.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ In addition to all arguments above, the following attributes are exported:
* `custom_data` - Custom data to include in the metadata file named `.complete` that Atlas uploads to the bucket when the export job finishes. Custom data can be specified as key and value pairs.
* `components` - _Returned for sharded clusters only._ Export job details for each replica set in the sharded cluster.
* `created_at` - Timestamp in ISO 8601 date and time format in UTC when the export job was created.
* `err_msg` - Error message, only if the export job failed.
* `err_msg` - Error message, only if the export job failed. **Note:** This attribute is deprecated as it is not being used.
* `export_status` - _Returned for replica set only._ Status of the export job.
* `finished_at` - Timestamp in ISO 8601 date and time format in UTC when the export job completes.
* `export_job_id` - Unique identifier of the export job.
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ We ship binaries but do not prioritize fixes for the following operating system
## Examples from MongoDB and the Community

<!-- NOTE: the below examples link is updated during the release process, when doing changes in the following sentence verify scripts/update-examples-reference-in-docs.sh is not impacted-->
We have [example configurations](https://github.com/mongodb/terraform-provider-mongodbatlas/tree/v1.17.3/examples)
We have [example configurations](https://github.com/mongodb/terraform-provider-mongodbatlas/tree/v1.17.6/examples)
in our GitHub repo that will help both beginner and more advanced users.

Have a good example you've created and want to share?
Expand Down
25 changes: 22 additions & 3 deletions docs/resources/cloud_backup_snapshot_export_bucket.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

## Example Usage


### AWS Example

```terraform
resource "mongodbatlas_cloud_backup_snapshot_export_bucket" "test" {
project_id = "{PROJECT_ID}"
Expand All @@ -16,12 +19,28 @@ resource "mongodbatlas_cloud_backup_snapshot_export_bucket" "test" {
}
```

### Azure Example

```terraform
resource "mongodbatlas_cloud_backup_snapshot_export_bucket" "test" {
project_id = "{PROJECT_ID}"
role_id = "{ROLE_ID}"
service_url = "{SERVICE_URL}"
tenant_id = "{TENANT_ID}"
bucket_name = "example-bucket"
cloud_provider = "AZURE"
}
```

## Argument Reference

* `project_id` - (Required) The unique identifier of the project for the Atlas cluster.
* `iam_role_id` - (Required) Unique identifier of the role that Atlas can use to access the bucket. You must also specify the `bucket_name`.
* `bucket_name` - (Required) Name of the bucket that the provided role ID is authorized to access. You must also specify the `iam_role_id`.
* `cloud_provider` - (Required) Name of the provider of the cloud service where Atlas can access the S3 bucket. Atlas only supports `AWS`.
* `bucket_name` - (Required) Name of the bucket that the provided role ID is authorized to access.
* `cloud_provider` - (Required) Name of the provider of the cloud service where Atlas can access the S3 bucket.
* `iam_role_id` - Unique identifier of the role that Atlas can use to access the bucket. Required if `cloud_provider` is set to `AWS`.
* `role_id` - Unique identifier of the Azure Service Principal that Atlas can use to access the Azure Blob Storage Container. Required if `cloud_provider` is set to `AZURE`.
* `service_url` - URL that identifies the blob Endpoint of the Azure Blob Storage Account. Required if `cloud_provider` is set to `AZURE`.
* `tenant_id` - UUID that identifies the Azure Active Directory Tenant ID. Required if `cloud_provider` is set to `AZURE`.

## Attributes Reference

Expand Down
2 changes: 1 addition & 1 deletion docs/resources/cloud_backup_snapshot_export_job.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ In addition to all arguments above, the following attributes are exported:

* `components` - _Returned for sharded clusters only._ Export job details for each replica set in the sharded cluster.
* `created_at` - Timestamp in ISO 8601 date and time format in UTC when the export job was created.
* `err_msg` - Error message, only if the export job failed.
* `err_msg` - Error message, only if the export job failed. **Note:** This attribute is deprecated as it is not being used.
* `export_status` - _Returned for replica set only._ Status of the export job.
* `finished_at` - Timestamp in ISO 8601 date and time format in UTC when the export job completes.
* `export_job_id` - Unique identifier of the export job.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# MongoDB Atlas Provider - Atlas Cloud Backup Snapshot Export Bucket in AWS

This example shows how to set up Cloud Backup Snapshot Export Bucket in Atlas through Terraform.

You must set the following variables:

- `public_key`: Atlas public key
- `private_key`: Atlas private key
- `project_id`: Unique 24-hexadecimal digit string that identifies the project where the stream instance will be created.
- `access_key`: AWS Access Key
- `secret_key`: AWS Secret Key.
- `aws_region`: AWS region.

To learn more, see the [Export Cloud Backup Snapshot Documentation](https://www.mongodb.com/docs/atlas/backup/cloud-backup/export/).


Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# MongoDB Atlas Provider - Atlas Cloud Backup Snapshot Export Bucket in Azure

This example shows how to set up Cloud Backup Snapshot Export Bucket in Atlas through Terraform.

You must set the following variables:

- `public_key`: Atlas public key.
- `private_key`: Atlas private key.
- `project_id`: Unique 24-hexadecimal digit string that identifies the project where the stream instance will be created.
- `azure_tenant_id`: The Tenant ID which should be used.
- `subscription_id`: Azure Subscription ID.
- `client_id`: Azure Client ID.
- `client_secret`: Azure Client Secret.
- `tenant_id`: Azure Tenant ID.
- `azure_atlas_app_id`: The client ID of the application for which to create a service principal.
- `azure_resource_group_location`: The Azure Region where the Resource Group should exist.
- `storage_account_name`: Specifies the name of the storage account.

To learn more, see the [Export Cloud Backup Snapshot Documentation](https://www.mongodb.com/docs/atlas/backup/cloud-backup/export/).


Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
resource "azuread_service_principal" "mongo" {
client_id = var.azure_atlas_app_id
app_role_assignment_required = false
}

# Define the resource group
resource "azurerm_resource_group" "test_resource_group" {
name = "mongo-test-resource-group"
location = var.azure_resource_group_location
}

resource "azurerm_storage_account" "test_storage_account" {
name = var.storage_account_name
resource_group_name = azurerm_resource_group.test_resource_group.name
location = azurerm_resource_group.test_resource_group.location
account_tier = "Standard"
account_replication_type = "LRS"
}

resource "azurerm_storage_container" "test_storage_container" {
name = "mongo-test-storage-container"
storage_account_name = azurerm_storage_account.test_storage_account.name
container_access_type = "private"
}

resource "azurerm_role_assignment" "test_role_assignment" {
principal_id = azuread_service_principal.mongo.id
role_definition_name = "Storage Blob Data Contributor"
scope = azurerm_storage_account.test_storage_account.id
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
resource "mongodbatlas_cloud_provider_access_setup" "setup_only" {
project_id = var.project_id
provider_name = "AZURE"
azure_config {
atlas_azure_app_id = var.azure_atlas_app_id
service_principal_id = azuread_service_principal.mongo.id
tenant_id = var.tenant_id
}
}

resource "mongodbatlas_cloud_provider_access_authorization" "auth_role" {
project_id = var.project_id
role_id = mongodbatlas_cloud_provider_access_setup.setup_only.role_id

azure {
atlas_azure_app_id = var.azure_atlas_app_id
service_principal_id = azuread_service_principal.mongo.id
tenant_id = var.tenant_id
}
}


resource "mongodbatlas_cloud_backup_snapshot_export_bucket" "test" {
project_id = var.tenant_id
bucket_name = azurerm_storage_container.test_storage_container.name
cloud_provider = "AZURE"
service_url = azurerm_storage_account.test_storage_account.primary_blob_endpoint
role_id = mongodbatlas_cloud_provider_access_authorization.auth_role.role_id
tenant_id = var.tenant_id
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
provider "mongodbatlas" {
public_key = var.public_key
private_key = var.private_key
}
provider "azuread" {
tenant_id = var.azure_tenant_id
}
provider "azurerm" {
subscription_id = var.subscription_id
client_id = var.client_id
client_secret = var.client_secret
tenant_id = var.tenant_id
features {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
variable "public_key" {
description = "The public API key for MongoDB Atlas"
type = string
}
variable "private_key" {
description = "The private API key for MongoDB Atlas"
type = string
}
variable "project_id" {
description = "Atlas project ID"
type = string
}
variable "azure_tenant_id" {
type = string
}
variable "subscription_id" {
default = "Azure Subscription ID"
type = string
}
variable "client_id" {
default = "Azure Client ID"
type = string
}
variable "client_secret" {
default = "Azure Client Secret"
type = string
}
variable "tenant_id" {
default = "Azure Tenant ID"
type = string
}
variable "azure_atlas_app_id" {
type = string
}
variable "azure_resource_group_location" {
type = string
}
variable "storage_account_name" {
type = string
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
terraform {
required_providers {
azuread = {
source = "hashicorp/azuread"
version = "~> 2.53.1"
}
azurerm = {
source = "hashicorp/azurerm"
version = "~> 3.0"
}
mongodbatlas = {
source = "mongodb/mongodbatlas"
version = "~> 1.0"
}
}
required_version = ">= 1.0"
}
Loading
Loading