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

doc: Adds an example using ignore_changes when autoscaling is enabled #2077

Merged
merged 1 commit into from
Mar 26, 2024
Merged
Changes from all commits
Commits
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
19 changes: 15 additions & 4 deletions website/docs/r/advanced_cluster.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ resource "mongodbatlas_advanced_cluster" "test" {
}
```

### Example Multi-Cloud Cluster.
### Example Multi-Cloud Cluster
```terraform
resource "mongodbatlas_advanced_cluster" "test" {
project_id = "PROJECT ID"
Expand Down Expand Up @@ -133,7 +133,7 @@ resource "mongodbatlas_advanced_cluster" "test" {
}
}
```
### Example of a Multi-Cloud Cluster.
### Example of a Multi-Cloud Cluster

```terraform
resource "mongodbatlas_advanced_cluster" "cluster" {
Expand Down Expand Up @@ -196,7 +196,7 @@ resource "mongodbatlas_advanced_cluster" "cluster" {
}
```

### Example of a Global Cluster.
### Example of a Global Cluster
```terraform
resource "mongodbatlas_advanced_cluster" "cluster" {
project_id = mongodbatlas_project.project.id
Expand Down Expand Up @@ -604,6 +604,18 @@ To prevent this a lifecycle customization should be used, i.e.:
}`
After adding the `lifecycle` block to explicitly change `disk_size_gb` comment out the `lifecycle` block and run `terraform apply`. Please be sure to uncomment the `lifecycle` block once done to prevent any accidental changes.

```terraform
// Example: ignore disk_size_gb and instance_size changes in a replica set
lifecycle {
ignore_changes = [
disk_size_gb,
replication_specs[0].region_configs[0].electable_specs[0].instance_size,
replication_specs[0].region_configs[1].electable_specs[0].instance_size,
replication_specs[0].region_configs[2].electable_specs[0].instance_size,
]
}
```

* `compute_enabled` - (Optional) Flag that indicates whether instance size auto-scaling is enabled. This parameter defaults to false.

~> **IMPORTANT:** If `compute_enabled` is true, then Atlas will automatically scale up to the maximum provided and down to the minimum, if provided.
Expand All @@ -618,7 +630,6 @@ After adding the `lifecycle` block to explicitly change `instance_size` comment
* `compute_min_instance_size` - (Optional) Minimum instance size to which your cluster can automatically scale (such as M10). Atlas requires this parameter if `replication_specs.#.region_configs.#.auto_scaling.0.compute_scale_down_enabled` is true.
* `compute_max_instance_size` - (Optional) Maximum instance size to which your cluster can automatically scale (such as M40). Atlas requires this parameter if `replication_specs.#.region_configs.#.auto_scaling.0.compute_enabled` is true.


### analytics_auto_scaling

* `disk_gb_enabled` - (Optional) Flag that indicates whether this cluster enables disk auto-scaling. This parameter defaults to true.
Expand Down