For resource mongodbatlas_cluster all properties related to provider move to separate block
Current resource
resource "mongodbatlas_cluster" "cluster" {
project_id = var.project_id
name = var.cluster_name
disk_size_gb = var.disk_size_gb
num_shards = var.num_shards
replication_factor = var.replication_factor
auto_scaling_disk_gb_enabled = var.auto_scaling_disk_gb_enabled
mongo_db_major_version = var.mongo_db_major_version
//Provider Settings "block"
provider_name = var.provider_name
provider_disk_iops = var.provider_disk_iops
provider_volume_type = var.provider_volume_type
provider_instance_size_name = var.provider_instance_size_name
provider_region_name = var.provider_region_name
provider_backup_enabled = var.provider_backup_enabled
}
Suggested resource
resource "mongodbatlas_cluster" "cluster" {
project_id = var.project_id
name = var.cluster_name
disk_size_gb = var.disk_size_gb
num_shards = var.num_shards
replication_factor = var.replication_factor
auto_scaling_disk_gb_enabled = var.auto_scaling_disk_gb_enabled
mongo_db_major_version = var.mongo_db_major_version
//Provider Settings "block"
cluster_provider = {
name = var.provider_name
disk_iops = var.provider_disk_iops
volume_type = var.provider_volume_type
instance_size_name = var.provider_instance_size_name
region_name = var.provider_region_name
backup_enabled = var.provider_backup_enabled
}
}
cluster_provider property will be a map of configuration for provider.
3
votes
Gregory
shared this idea