File tree Expand file tree Collapse file tree 2 files changed +166
-0
lines changed
internal/convert/testdata/adv2v2 Expand file tree Collapse file tree 2 files changed +166
-0
lines changed Original file line number Diff line number Diff line change 1+ locals {
2+ replication_specs_list = [
3+ {
4+ zone_name = " zone1"
5+ region_name = " US_EAST_1"
6+ },
7+ {
8+ zone_name = " zone2"
9+ region_name = " US_WEST_2"
10+ }
11+ ]
12+ }
13+
14+ resource "mongodbatlas_advanced_cluster" "one_config" {
15+ project_id = " 123"
16+ name = " cluster"
17+ cluster_type = " SHARDED"
18+
19+ dynamic "replication_specs" {
20+ for_each = local. replication_specs_list
21+ content {
22+ num_shards = 2
23+ zone_name = replication_specs. value . zone_name
24+
25+ region_configs {
26+ provider_name = " AWS"
27+ region_name = replication_specs. value . region_name
28+ priority = 7
29+
30+ electable_specs {
31+ instance_size = " M10"
32+ node_count = 3
33+ }
34+ auto_scaling {
35+ disk_gb_enabled = true
36+ }
37+ }
38+ }
39+ }
40+ }
41+
42+ resource "mongodbatlas_advanced_cluster" "multiple_config" {
43+ project_id = " 123"
44+ name = " cluster"
45+ cluster_type = " SHARDED"
46+
47+ dynamic "replication_specs" {
48+ for_each = local. replication_specs_list
49+ content {
50+ num_shards = 2
51+ zone_name = replication_specs. value . zone_name
52+
53+ region_configs {
54+ provider_name = " AWS"
55+ region_name = replication_specs. value . region_name
56+ priority = 7
57+
58+ electable_specs {
59+ instance_size = " M10"
60+ node_count = 2
61+ }
62+ auto_scaling {
63+ disk_gb_enabled = true
64+ }
65+ }
66+
67+ region_configs {
68+ provider_name = " AWS"
69+ region_name = replication_specs. value . region_name
70+ priority = 6
71+
72+ electable_specs {
73+ instance_size = " M10"
74+ node_count = 1
75+ }
76+ auto_scaling {
77+ disk_gb_enabled = true
78+ }
79+ }
80+ }
81+ }
82+ }
Original file line number Diff line number Diff line change 1+ locals {
2+ replication_specs_list = [
3+ {
4+ zone_name = " zone1"
5+ region_name = " US_EAST_1"
6+ },
7+ {
8+ zone_name = " zone2"
9+ region_name = " US_WEST_2"
10+ }
11+ ]
12+ }
13+
14+ resource "mongodbatlas_advanced_cluster" "one_config" {
15+ project_id = " 123"
16+ name = " cluster"
17+ cluster_type = " SHARDED"
18+
19+ replication_specs = flatten ([
20+ for spec in local . replication_specs_list : [
21+ for i in range (2 ) : {
22+ zone_name = spec . zone_name
23+ region_configs = [
24+ {
25+ priority = 7
26+ provider_name = " AWS"
27+ region_name = spec.region_name
28+ electable_specs = {
29+ instance_size = " M10"
30+ node_count = 3
31+ }
32+ auto_scaling = {
33+ disk_gb_enabled = true
34+ }
35+ }
36+ ]
37+ }
38+ ]
39+ ])
40+
41+ # Updated by atlas-cli-plugin-terraform, please review the changes.
42+ }
43+
44+ resource "mongodbatlas_advanced_cluster" "multiple_config" {
45+ project_id = " 123"
46+ name = " cluster"
47+ cluster_type = " SHARDED"
48+
49+ replication_specs = flatten ([
50+ for spec in local . replication_specs_list : [
51+ for i in range (2 ) : {
52+ zone_name = spec . zone_name
53+ region_configs = [
54+ {
55+ priority = 7
56+ provider_name = " AWS"
57+ region_name = spec.region_name
58+ electable_specs = {
59+ instance_size = " M10"
60+ node_count = 2
61+ }
62+ auto_scaling = {
63+ disk_gb_enabled = true
64+ }
65+ },
66+ {
67+ priority = 6
68+ provider_name = " AWS"
69+ region_name = spec.region_name
70+ electable_specs = {
71+ instance_size = " M10"
72+ node_count = 1
73+ }
74+ auto_scaling = {
75+ disk_gb_enabled = true
76+ }
77+ }
78+ ]
79+ }
80+ ]
81+ ])
82+
83+ # Updated by atlas-cli-plugin-terraform, please review the changes.
84+ }
You can’t perform that action at this time.
0 commit comments