Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
5c4b91b
feat: Updates GA status for `mongodbatlas_flex_cluster` resource and …
oarbusi Jan 27, 2025
9b1fcb5
chore: Adds cipher config & default_max_time_ms to advanced_cluster_t…
maastha Jan 24, 2025
4066091
chore: Implements `tags` and `labels` as MapAttribute in `advanced_cl…
lantoli Jan 24, 2025
62e4124
feat: Supports Flex Clusters in `mongodbatlas_advanced_cluster` resou…
oarbusi Jan 30, 2025
a38e293
deprecate: Deprecates Serverless and Shared-tier functionality (#3012)
oarbusi Feb 3, 2025
c29741c
feat: Supports Flex Clusters in `mongodbatlas_advanced_cluster` resou…
oarbusi Feb 5, 2025
bc8c137
Merge branch 'master' into CLOUDP-282554-flex-ga
oarbusi Feb 5, 2025
aa60583
feat: Supports Flex Clusters in `mongodbatlas_advanced_cluster` data …
oarbusi Feb 6, 2025
35a1779
feat: Supports retrieval of Flex clusters snapshots using `mongodbatl…
oarbusi Feb 6, 2025
1ffbd2b
chore: Merges latest TPF changes and simplifies flex data sources (#3…
EspenAlbert Feb 6, 2025
ea4d8e6
feat: Supports retrieval of Flex clusters restore jobs using `mongodb…
oarbusi Feb 7, 2025
b00cff4
chore: Set default priority (7) for imported flex clusters in mongodb…
oarbusi Feb 12, 2025
6a35525
chore: Merge branch 'master' into CLOUDP-282554-flex-ga (#3066)
maastha Feb 13, 2025
ac2a875
doc: Document Flex cluster support in `mongodbatlas_advanced_cluster`…
oarbusi Feb 19, 2025
8bcb38f
Merge branch 'master' into CLOUDP-282554-flex-ga
oarbusi Feb 19, 2025
6e4e0c3
Merge branch 'master' into CLOUDP-282554-flex-ga
oarbusi Feb 19, 2025
0031d03
chore: Implements upgrade from M0 to Flex in `mongodbatlas_advanced_c…
maastha Feb 19, 2025
e913f02
chore: Fixes inconsistent result errors (#3089)
EspenAlbert Feb 20, 2025
28e479b
doc: Adds examples for flex clusters in `mongodbatlas_advanced_cluste…
oarbusi Feb 20, 2025
6c0e6c7
chore: Implements upgrade from Flex to Dedicated in `mongodbatlas_adv…
oarbusi Feb 20, 2025
77fb14b
m2 m5 mentions removed
oarbusi Feb 20, 2025
b85207e
run M0 test non paralelly
oarbusi Feb 20, 2025
bddfab1
doc: Recommends `mongodbatlas_advanced_cluster` in the migration guid…
oarbusi Feb 20, 2025
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/3001.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
```release-note:enhancement
resource/mongodbatlas_advanced_cluster: This resource can now create, read, update, and delete Flex clusters
```

```release-note:enhancement
data-source/mongodbatlas_advanced_cluster: This data source can now read Flex clusters
```

```release-note:enhancement
data-source/mongodbatlas_advanced_clusters: This data source can now read Flex clusters
```
11 changes: 11 additions & 0 deletions .changelog/3003.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
```release-note:enhancement
resource/mongodbatlas_flex_cluster: Reaches GA (General Availability)
```

```release-note:enhancement
data-source/mongodbatlas_flex_cluster: Reaches GA (General Availability)
```

```release-note:enhancement
data-source/mongodbatlas_flex_cluster: Reaches GA (General Availability)
```
35 changes: 35 additions & 0 deletions .changelog/3012.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
```release-note:note
resource/mongodbatlas_serverless_instance: Deprecates resource
```

```release-note:note
data-source/mongodbatlas_serverless_instance: Deprecates data source
```

```release-note:note
data-source/mongodbatlas_serverless_instances: Deprecates data source
```

```release-note:note
data-source/mongodbatlas_shared_tier_restore_job: Deprecates data source
```

```release-note:note
data-source/mongodbatlas_shared_tier_restore_jobs: Deprecates data source
```

```release-note:note
data-source/mongodbatlas_shared_tier_snapshot: Deprecates data source
```

```release-note:note
data-source/mongodbatlas_shared_tier_snapshot: Deprecates data source
```

```release-note:note
resource/mongodbatlas_cluster: Deprecates `M2` and `M5` instance size values for the attribute `provider_instance_size_name`
```

```release-note:note
resource/mongodbatlas_advanced_cluster: Deprecates `M2` and `M5` instance size for the attribute `instance_size` inside of `analytics_specs`, `electable_specs` and `read_only_specs`
```
7 changes: 7 additions & 0 deletions .changelog/3036.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
```release-note:new-datasource
mongodbatlas_flex_snapshot
```

```release-note:new-datasource
mongodbatlas_flex_snapshots
```
7 changes: 7 additions & 0 deletions .changelog/3041.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
```release-note:new-datasource
mongodbatlas_flex_restore_job
```

```release-note:new-datasource
mongodbatlas_flex_restore_jobs
```
1 change: 0 additions & 1 deletion .github/workflows/acceptance-tests-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,6 @@ jobs:
env:
MONGODB_ATLAS_LAST_VERSION: ${{ needs.get-provider-version.outputs.provider_version }}
MONGODB_ATLAS_FLEX_PROJECT_ID: ${{ inputs.mongodb_atlas_flex_project_id }}
MONGODB_ATLAS_ENABLE_PREVIEW: "true"
ACCTEST_PACKAGES: ./internal/service/flexcluster
run: make testacc

Expand Down
26 changes: 26 additions & 0 deletions docs/data-sources/advanced_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<br> &#8226; Changes to cluster configurations can affect costs. Before making changes, please see [Billing](https://docs.atlas.mongodb.com/billing/).
<br> &#8226; If your Atlas project contains a custom role that uses actions introduced in a specific MongoDB version, you cannot create a cluster with a MongoDB version less than that version unless you delete the custom role.

-> **NOTE:** This data source also includes Flex clusters.

## Example Usage

```terraform
Expand Down Expand Up @@ -80,6 +82,30 @@ data "mongodbatlas_advanced_cluster" "example" {
}
```

## Example using Flex cluster

```terraform
resource "mongodbatlas_advanced_cluster" "example-flex" {
project_id = "<YOUR-PROJECT-ID>"
name = "flex-cluster"
cluster_type = "REPLICASET"

replication_specs {
region_configs {
provider_name = "FLEX"
backing_provider_name = "AWS"
region_name = "US_EAST_1"
priority = 7
}
}
}

data "mongodbatlas_advanced_cluster" "example" {
project_id = mongodbatlas_advanced_cluster.example-flex.project_id
name = mongodbatlas_advanced_cluster.example-flex.name
}
```

## Argument Reference

* `project_id` - (Required) The unique ID for the project to create the database user.
Expand Down
25 changes: 25 additions & 0 deletions docs/data-sources/advanced_clusters.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<br> &#8226; Changes to cluster configurations can affect costs. Before making changes, please see [Billing](https://docs.atlas.mongodb.com/billing/).
<br> &#8226; If your Atlas project contains a custom role that uses actions introduced in a specific MongoDB version, you cannot create a cluster with a MongoDB version less than that version unless you delete the custom role.

-> **NOTE:** This data source also includes Flex clusters.

## Example Usage

```terraform
Expand Down Expand Up @@ -79,6 +81,29 @@ data "mongodbatlas_advanced_cluster" "example-asym" {
}
```

## Example using Flex cluster

```terraform
resource "mongodbatlas_advanced_cluster" "example-flex" {
project_id = "<YOUR-PROJECT-ID>"
name = "flex-cluster"
cluster_type = "REPLICASET"

replication_specs {
region_configs {
provider_name = "FLEX"
backing_provider_name = "AWS"
region_name = "US_EAST_1"
priority = 7
}
}
}

data "mongodbatlas_advanced_clusters" "example" {
project_id = mongodbatlas_advanced_cluster.example-flex.project_id
}
```

## Argument Reference

* `project_id` - (Required) The unique ID for the project to get the clusters.
Expand Down
6 changes: 6 additions & 0 deletions docs/data-sources/cloud_provider_shared_tier_restore_job.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
subcategory: "Deprecated"
---

**WARNING:** This data source is deprecated and will be removed in January 2026. For more details, see [Migration Guide: Transition out of Serverless Instances and Shared-tier clusters](https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/guides/serverless-shared-migration-guide).

# Data Source: mongodbatlas_shared_tier_restore_job

`mongodbatlas_shared_tier_restore_job` provides a Cloud Backup Snapshot Restore Job data source for Shared Tier Clusters. Gets the cloud backup snapshot restore jobs for the specified shared tier cluster.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
subcategory: "Deprecated"
---

**WARNING:** This data source is deprecated and will be removed in January 2026. For more details, see [Migration Guide: Transition out of Serverless Instances and Shared-tier clusters](https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/guides/serverless-shared-migration-guide).

# Data Source: mongodbatlas_shared_tier_restore_jobs

`mongodbatlas_shared_tier_restore_jobs` provides Cloud Backup Snapshot Restore Jobs data source for Shared Tier Clusters. Gets all the cloud backup snapshot restore jobs for the specified shared tier cluster.
Expand Down
6 changes: 6 additions & 0 deletions docs/data-sources/cloud_provider_shared_tier_snapshot.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
subcategory: "Deprecated"
---

**WARNING:** This data source is deprecated and will be removed in January 2026. For more details, see [Migration Guide: Transition out of Serverless Instances and Shared-tier clusters](https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/guides/serverless-shared-migration-guide).

# Data Source: mongodbatlas_shared_tier_snapshot

`mongodbatlas_shared_tier_snapshot` provides an Cloud Backup Snapshot data source for Shared Tier Clusters. Atlas Cloud Backup Snapshots provide localized backup storage using the native snapshot functionality of the cluster’s cloud service.
Expand Down
6 changes: 6 additions & 0 deletions docs/data-sources/cloud_provider_shared_tier_snapshots.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
subcategory: "Deprecated"
---

**WARNING:** This data source is deprecated and will be removed in January 2026. For more details, see [Migration Guide: Transition out of Serverless Instances and Shared-tier clusters](https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/guides/serverless-shared-migration-guide).

# Data Source: mongodbatlas_shared_tier_snapshots

`mongodbatlas_shared_tier_snapshots` provides an Cloud Backup Snapshots data source for Shared Tier Clusters. Atlas Cloud Backup Snapshots provide localized backup storage using the native snapshot functionality of the cluster’s cloud service.
Expand Down
2 changes: 1 addition & 1 deletion docs/data-sources/flex_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

`mongodbatlas_flex_cluster` describes a flex cluster.

**NOTE:** Flex Cluster is in Public Preview. In order to use the resource and data sources you need to set the environment variable MONGODB_ATLAS_ENABLE_PREVIEW to true.
**RECOMMENDATION:** We recommend using the `mongodbatlas_advanced_cluster` data source instead of `mongodbatlas_flex_cluster` data source to retrieve Flex clusters. The `mongodbatlas_advanced_cluster` data source not only supports Flex clusters, but also supports free and dedicated clusters, providing easier migration between different cluster types. For more information, see the [Advanced Cluster](https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/data-sources/advanced_cluster) data source.

## Example Usages
```terraform
Expand Down
2 changes: 1 addition & 1 deletion docs/data-sources/flex_clusters.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

`mongodbatlas_flex_clusters` returns all flex clusters in a project.

**NOTE:** Flex Cluster is in Public Preview. In order to use the resource and data sources you need to set the environment variable MONGODB_ATLAS_ENABLE_PREVIEW to true.
**RECOMMENDATION:** We recommend using the `mongodbatlas_advanced_clusters` data source instead of the `mongodbatlas_flex_clusters` data source to retrieve Flex clusters. The `mongodbatlas_advanced_clusters` data source not only supports Flex clusters, but also supports free and dedicated clusters, providing easier migration between different cluster types. For more information, see the [Advanced Clusters](https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/data-sources/advanced_clusters) data source.

## Example Usages
```terraform
Expand Down
51 changes: 51 additions & 0 deletions docs/data-sources/flex_restore_job.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Data Source: mongodbatlas_flex_restore_job

`mongodbatlas_flex_restore_job` describes a flex restore job.

## Example Usages
```terraform
data "mongodbatlas_flex_restore_job" "restore_job" {
project_id = var.project_id
name = mongodbatlas_flex_cluster.example-cluster.name
restore_job_id = var.restore_job_id
}

data "mongodbatlas_flex_restore_jobs" "restore_jobs" {
project_id = var.project_id
name = mongodbatlas_flex_cluster.example-cluster.name
}

output "mongodbatlas_flex_restore_job" {
value = data.mongodbatlas_flex_restore_job.restore_job.name
}

output "mongodbatlas_flex_restore_jobs" {
value = [for restore_job in data.mongodbatlas_flex_restore_jobs.restore_jobs.results : restore_job.restore_job_id]
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `name` (String) Human-readable label that identifies the flex cluster whose snapshot you want to restore.
- `project_id` (String) Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access.

**NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups.
- `restore_job_id` (String) Unique 24-hexadecimal digit string that identifies the restore job.

### Read-Only

- `delivery_type` (String) Means by which this resource returns the snapshot to the requesting MongoDB Cloud user.
- `expiration_date` (String) Date and time when the download link no longer works. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
- `restore_finished_date` (String) Date and time when MongoDB Cloud completed writing this snapshot. MongoDB Cloud changes the status of the restore job to `CLOSED`. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
- `restore_scheduled_date` (String) Date and time when MongoDB Cloud will restore this snapshot. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
- `snapshot_finished_date` (String) Date and time when MongoDB Cloud completed writing this snapshot. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
- `snapshot_id` (String) Unique 24-hexadecimal digit string that identifies the snapshot to restore.
- `snapshot_url` (String) Internet address from which you can download the compressed snapshot files. The resource returns this parameter when `"deliveryType" : "DOWNLOAD"`.
- `status` (String) Phase of the restore workflow for this job at the time this resource made this request.
- `target_deployment_item_name` (String) Human-readable label that identifies the instance or cluster on the target project to which you want to restore the snapshot. You can restore the snapshot to another flex cluster or dedicated cluster tier.
- `target_project_id` (String) Unique 24-hexadecimal digit string that identifies the project that contains the instance or cluster to which you want to restore the snapshot.

For more information see: [MongoDB Atlas API - Flex Restore Job](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Flex-Restore-Jobs/operation/getFlexBackupRestoreJob) Documentation.
62 changes: 62 additions & 0 deletions docs/data-sources/flex_restore_jobs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Data Source: mongodbatlas_flex_restore_jobs

`mongodbatlas_flex_restore_jobs` returns all flex restore job of a flex cluster.

## Example Usages
```terraform
data "mongodbatlas_flex_restore_job" "restore_job" {
project_id = var.project_id
name = mongodbatlas_flex_cluster.example-cluster.name
restore_job_id = var.restore_job_id
}

data "mongodbatlas_flex_restore_jobs" "restore_jobs" {
project_id = var.project_id
name = mongodbatlas_flex_cluster.example-cluster.name
}

output "mongodbatlas_flex_restore_job" {
value = data.mongodbatlas_flex_restore_job.restore_job.name
}

output "mongodbatlas_flex_restore_jobs" {
value = [for restore_job in data.mongodbatlas_flex_restore_jobs.restore_jobs.results : restore_job.restore_job_id]
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `name` (String) Human-readable label that identifies the flex cluster whose snapshot you want to restore.
- `project_id` (String) Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access.

**NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups.

### Read-Only

- `results` (Attributes List) List of documents that MongoDB Cloud returns for this request. (see [below for nested schema](#nestedatt--results))

<a id="nestedatt--results"></a>
### Nested Schema for `results`

Read-Only:

- `delivery_type` (String) Means by which this resource returns the snapshot to the requesting MongoDB Cloud user.
- `expiration_date` (String) Date and time when the download link no longer works. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
- `name` (String) Human-readable label that identifies the flex cluster whose snapshot you want to restore.
- `project_id` (String) Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access.

**NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups.
- `restore_finished_date` (String) Date and time when MongoDB Cloud completed writing this snapshot. MongoDB Cloud changes the status of the restore job to `CLOSED`. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
- `restore_job_id` (String) Unique 24-hexadecimal digit string that identifies the restore job.
- `restore_scheduled_date` (String) Date and time when MongoDB Cloud will restore this snapshot. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
- `snapshot_finished_date` (String) Date and time when MongoDB Cloud completed writing this snapshot. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
- `snapshot_id` (String) Unique 24-hexadecimal digit string that identifies the snapshot to restore.
- `snapshot_url` (String) Internet address from which you can download the compressed snapshot files. The resource returns this parameter when `"deliveryType" : "DOWNLOAD"`.
- `status` (String) Phase of the restore workflow for this job at the time this resource made this request.
- `target_deployment_item_name` (String) Human-readable label that identifies the instance or cluster on the target project to which you want to restore the snapshot. You can restore the snapshot to another flex cluster or dedicated cluster tier.
- `target_project_id` (String) Unique 24-hexadecimal digit string that identifies the project that contains the instance or cluster to which you want to restore the snapshot.

For more information see: [MongoDB Atlas API - Flex Restore Job](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Flex-Restore-Jobs/operation/listFlexBackupRestoreJobs) Documentation.
47 changes: 47 additions & 0 deletions docs/data-sources/flex_snapshot.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Data Source: mongodbatlas_flex_snapshot

`mongodbatlas_flex_snapshot` describes a flex snapshot.

## Example Usages
```terraform
data "mongodbatlas_flex_snapshot" "snapshot" {
project_id = var.project_id
name = mongodbatlas_flex_cluster.example-cluster.name
snapshot_id = var.snapshot_id
}

data "mongodbatlas_flex_snapshots" "snapshots" {
project_id = var.project_id
name = mongodbatlas_flex_cluster.example-cluster.name
}

output "mongodbatlas_flex_snapshot" {
value = data.mongodbatlas_flex_snapshot.snapshot.name
}

output "mongodbatlas_flex_snapshots" {
value = [for snapshot in data.mongodbatlas_flex_snapshots.snapshots.results : snapshot.snapshot_id]
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `name` (String) Human-readable label that identifies the flex cluster whose snapshot you want to restore.
- `project_id` (String) Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access.

**NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups.
- `snapshot_id` (String) Unique 24-hexadecimal digit string that identifies the snapshot to restore.

### Read-Only

- `expiration` (String) Date and time when the download link no longer works. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
- `finish_time` (String) Date and time when MongoDB Cloud completed writing this snapshot. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
- `mongo_db_version` (String) MongoDB host version that the snapshot runs.
- `scheduled_time` (String) Date and time when MongoDB Cloud will take the snapshot. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
- `start_time` (String) Date and time when MongoDB Cloud began taking the snapshot. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
- `status` (String) Phase of the restore workflow for this job at the time this resource made this request.

For more information see: [MongoDB Atlas API - Flex Snapshots](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Flex-Snapshots/operation/getFlexBackup) Documentation.
Loading
Loading