Skip to content

Commit 279cd02

Browse files
authored
chore: Adds Flex GA documentation changes (#3087)
1 parent 3d61af7 commit 279cd02

3 files changed

+113
-2
lines changed

docs/data-sources/advanced_cluster (preview provider v2).md

+25
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ This doc is for the **Preview for MongoDB Atlas Provider v2** of `mongodbatlas_a
1010
<br> &#8226; Changes to cluster configurations can affect costs. Before making changes, please see [Billing](https://docs.atlas.mongodb.com/billing/).
1111
<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.
1212

13+
**NOTE:** This data source also includes Flex clusters.
14+
1315
## Example Usage
1416

1517
```terraform
@@ -80,6 +82,29 @@ data "mongodbatlas_advanced_cluster" "example" {
8082
}
8183
```
8284

85+
## Example using Flex cluster
86+
87+
```terraform
88+
resource "mongodbatlas_advanced_cluster" "example-flex" {
89+
project_id = "<YOUR-PROJECT-ID>"
90+
name = "flex-cluster"
91+
cluster_type = "REPLICASET"
92+
93+
replication_specs {
94+
region_configs {
95+
provider_name = "FLEX"
96+
backing_provider_name = "AWS"
97+
region_name = "US_EAST_1"
98+
priority = 7
99+
}
100+
}
101+
}
102+
data "mongodbatlas_advanced_cluster" "example" {
103+
project_id = mongodbatlas_advanced_cluster.example-flex.project_id
104+
name = mongodbatlas_advanced_cluster.example-flex.name
105+
}
106+
```
107+
83108
## Argument Reference
84109

85110
* `project_id` - (Required) The unique ID for the project to create the database user.

docs/data-sources/advanced_clusters (preview provider v2).md

+24
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ This doc is for the **Preview for MongoDB Atlas Provider v2** of `mongodbatlas_a
1010
<br> &#8226; Changes to cluster configurations can affect costs. Before making changes, please see [Billing](https://docs.atlas.mongodb.com/billing/).
1111
<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.
1212

13+
-> **NOTE:** This data source also includes Flex clusters.
14+
1315
## Example Usage
1416

1517
```terraform
@@ -79,6 +81,28 @@ data "mongodbatlas_advanced_cluster" "example-asym" {
7981
}
8082
```
8183

84+
## Example using Flex cluster
85+
86+
```terraform
87+
resource "mongodbatlas_advanced_cluster" "example-flex" {
88+
project_id = "<YOUR-PROJECT-ID>"
89+
name = "flex-cluster"
90+
cluster_type = "REPLICASET"
91+
92+
replication_specs {
93+
region_configs {
94+
provider_name = "FLEX"
95+
backing_provider_name = "AWS"
96+
region_name = "US_EAST_1"
97+
priority = 7
98+
}
99+
}
100+
}
101+
data "mongodbatlas_advanced_clusters" "example" {
102+
project_id = mongodbatlas_advanced_cluster.example-flex.project_id
103+
}
104+
```
105+
82106
## Argument Reference
83107

84108
* `project_id` - (Required) The unique ID for the project to get the clusters.

docs/resources/advanced_cluster (preview provider v2).md

+64-2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ More information on considerations for using advanced clusters please see [Consi
2020

2121
-> **NOTE:** Groups and projects are synonymous terms. You might find group_id in the official documentation.
2222

23+
-> **NOTE:** This resource supports Flex clusters. Additionally, you can upgrade [M0 clusters to Flex](#example-tenant-cluster-upgrade-to-flex) and [Flex clusters to Dedicated](#Example-Flex-Cluster-Upgrade). When creating a Flex cluster, make sure to set the priority value to 7.
2324

2425
## Example Usage
2526

@@ -73,9 +74,9 @@ resource "mongodbatlas_advanced_cluster" "test" {
7374

7475
**NOTE:** There can only be one M0 cluster per project.
7576

76-
**NOTE**: Upgrading the shared tier is supported. Any change from a shared tier cluster (a tenant) to a different instance size will be considered a tenant upgrade. When upgrading from the shared tier, change the `provider_name` from "TENANT" to your preferred provider (AWS, GCP or Azure) and remove the variable `backing_provider_name`. See the [Example Tenant Cluster Upgrade](#Example-Tenant-Cluster-Upgrade) below. You can upgrade a shared tier cluster only to a single provider on an M10-tier cluster or greater.
77+
**NOTE**: Upgrading the tenant cluster to a Flex cluster or a dedicated cluster is supported. When upgrading to a Flex cluster, change the `provider_name` from "TENANT" to "FLEX". See [Example Tenant Cluster Upgrade to Flex](#example-tenant-cluster-upgrade-to-flex) below. When upgrading to a dedicated cluster, change the `provider_name` to your preferred provider (AWS, GCP or Azure) and remove the variable `backing_provider_name`. See the [Example Tenant Cluster Upgrade](#Example-Tenant-Cluster-Upgrade) below. You can upgrade a tenant cluster only to a single provider on an M10-tier cluster or greater.
7778

78-
When upgrading from the shared tier, *only* the upgrade changes will be applied. This helps avoid a corrupt state file in the event that the upgrade succeeds but subsequent updates fail within the same `terraform apply`. To apply additional cluster changes, run a secondary `terraform apply` after the upgrade succeeds.
79+
When upgrading from the tenant, *only* the upgrade changes will be applied. This helps avoid a corrupt state file in the event that the upgrade succeeds but subsequent updates fail within the same `terraform apply`. To apply additional cluster changes, run a secondary `terraform apply` after the upgrade succeeds.
7980

8081

8182
### Example Tenant Cluster Upgrade
@@ -99,6 +100,67 @@ resource "mongodbatlas_advanced_cluster" "test" {
99100
}
100101
```
101102

103+
### Example Tenant Cluster Upgrade to Flex
104+
105+
```terraform
106+
resource "mongodbatlas_advanced_cluster" "example-flex" {
107+
project_id = "PROJECT ID"
108+
name = "NAME OF CLUSTER"
109+
cluster_type = "REPLICASET"
110+
replication_specs {
111+
region_configs {
112+
provider_name = "FLEX"
113+
backing_provider_name = "AWS"
114+
region_name = "US_EAST_1"
115+
priority = 7
116+
}
117+
}
118+
}
119+
```
120+
121+
### Example Flex Cluster
122+
123+
```terraform
124+
resource "mongodbatlas_advanced_cluster" "example-flex" {
125+
project_id = "PROJECT ID"
126+
name = "NAME OF CLUSTER"
127+
cluster_type = "REPLICASET"
128+
replication_specs {
129+
region_configs {
130+
provider_name = "FLEX"
131+
backing_provider_name = "AWS"
132+
region_name = "US_EAST_1"
133+
priority = 7
134+
}
135+
}
136+
}
137+
```
138+
139+
**NOTE**: Upgrading the Flex cluster is supported. When upgrading from a Flex cluster, change the `provider_name` from "TENANT" to your preferred provider (AWS, GCP or Azure) and remove the variable `backing_provider_name`. See the [Example Flex Cluster Upgrade](#Example-Flex-Cluster-Upgrade) below. You can upgrade a Flex cluster only to a single provider on an M10-tier cluster or greater.
140+
141+
When upgrading from a flex cluster, *only* the upgrade changes will be applied. This helps avoid a corrupt state file in the event that the upgrade succeeds but subsequent updates fail within the same `terraform apply`. To apply additional cluster changes, run a secondary `terraform apply` after the upgrade succeeds.
142+
143+
144+
### Example Flex Cluster Upgrade
145+
146+
```terraform
147+
resource "mongodbatlas_advanced_cluster" "test" {
148+
project_id = "PROJECT ID"
149+
name = "NAME OF CLUSTER"
150+
cluster_type = "REPLICASET"
151+
replication_specs {
152+
region_configs {
153+
electable_specs {
154+
instance_size = "M10"
155+
}
156+
provider_name = "AWS"
157+
region_name = "US_EAST_1"
158+
priority = 7
159+
}
160+
}
161+
}
162+
```
163+
102164
### Example Multi-Cloud Cluster
103165
```terraform
104166
resource "mongodbatlas_advanced_cluster" "test" {

0 commit comments

Comments
 (0)