You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Terraform CLI and Terraform MongoDB Atlas Provider Version
1.5.2 / 1.10.0
Terraform Configuration File
Seemingly irrelevant
resource"mongodbatlas_advanced_cluster""xg_mongo_cluster" {
for_each=var.cluster_configproject_id=var.project_idname=each.keycluster_type="REPLICASET"mongo_db_major_version=each.value.mongo_db_major_versiontermination_protection_enabled=truedisk_size_gb=20backup_enabled=truereplication_specs {
num_shards=1zone_name="Zone 1"// Note: total number of electable_nodes must be 3, 5 or 7 accross all regions.// We currently use 3 + 2 = 5.// Note: priority must be unique accross all regions.// The advice is to start with 7 and count down, and use 0 for read-only regions.dynamic"region_configs" {
for_each=each.value.replication_regionscontent {
// generic configregion_name=region_configs.value.region_namepriority=region_configs.value.priorityprovider_name="GCP"auto_scaling {
disk_gb_enabled=truecompute_enabled=truecompute_scale_down_enabled=truecompute_min_instance_size=each.value.compute_min_instance_sizecompute_max_instance_size=each.value.compute_max_instance_size
}
// electables, read only, and analytics nodeselectable_specs {
node_count=region_configs.value.electable_nodes
}
read_only_specs {
node_count=region_configs.value.read_only_nodes
}
analytics_specs {
instance_size=each.value.analytics_sizenode_count=region_configs.value.analytics_nodes
}
}
}
}
advanced_configuration {
minimum_enabled_tls_protocol="TLS1_2"
}
lifecycle {
prevent_destroy=trueignore_changes=[
// These attributes can change after provisioning because we have auto scaling enabled.disk_size_gb,
]
}
depends_on=[
google_compute_network_peering.xg_atlas_network_peering,
]
}
When we plan a mongodb_advanced_cluster without the instance_size defined, we get an error
Expected Behavior
No error, use min and max of auto-scaling
Actual Behavior
Debug Output
Crash Output
Additional Context
We are trying to enable auto-scaling. However this is seemingly impossible as we can not ignore the lifecycle_change as suggested in the docs (it simply does not exist).
Since instance_size is nested in a list, we do not know how to ignore the lifecylce change dynamically (.0 is not an option as we use for_each)
Hi @jdegger,
While we investigate the issue further, some early suggestions that might be useful here.
We are trying to enable auto-scaling. However, this is seemingly impossible as we can not ignore the lifecycle_change as suggested in the docs (it simply does not exist).
Below is an example of ignore changes for instance_size in a static block. Can you let us know if this syntax works for you?
Terraform CLI and Terraform MongoDB Atlas Provider Version
1.5.2 / 1.10.0
Terraform Configuration File
Seemingly irrelevant
Steps to Reproduce
When we plan a mongodb_advanced_cluster without the instance_size defined, we get an error
Expected Behavior
No error, use min and max of auto-scaling
Actual Behavior
Debug Output
Crash Output
Additional Context
We are trying to enable auto-scaling. However this is seemingly impossible as we can not ignore the lifecycle_change as suggested in the docs (it simply does not exist).
Since instance_size is nested in a list, we do not know how to ignore the lifecylce change dynamically (
.0
is not an option as we usefor_each
)References
https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/advanced_cluster#instance_size
Shows as optional
The text was updated successfully, but these errors were encountered: