Skip to content

Commit aa0b30c

Browse files
committed
include tags in rep_spec test
1 parent 6d08f97 commit aa0b30c

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

internal/convert/testdata/adv2v2/dynamic_replication_specs_basic.in.tf

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,27 @@
11
resource "mongodbatlas_advanced_cluster" "dynamic_replication_specs" {
2+
lifecycle {
3+
precondition {
4+
condition = !(var.auto_scaling_disk_gb_enabled && var.disk_size > 0)
5+
error_message = "Must use either auto_scaling_disk_gb_enabled or disk_size, not both."
6+
}
7+
}
8+
29
project_id = var.project_id
310
name = var.cluster_name
411
cluster_type = "GEOSHARDED"
12+
13+
dynamic "tags" {
14+
for_each = var.tags
15+
content {
16+
key = tags.key
17+
value = tags.value
18+
}
19+
}
20+
tags {
21+
key = "Tag 2"
22+
value = "Value 2"
23+
}
24+
525
dynamic "replication_specs" {
626
for_each = var.replication_specs
727
content {

internal/convert/testdata/adv2v2/dynamic_replication_specs_basic.out.tf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
resource "mongodbatlas_advanced_cluster" "dynamic_replication_specs" {
2+
lifecycle {
3+
precondition {
4+
condition = !(var.auto_scaling_disk_gb_enabled && var.disk_size > 0)
5+
error_message = "Must use either auto_scaling_disk_gb_enabled or disk_size, not both."
6+
}
7+
}
8+
29
project_id = var.project_id
310
name = var.cluster_name
411
cluster_type = "GEOSHARDED"
12+
13+
514
replication_specs = flatten([
615
for spec in var.replication_specs : [
716
for i in range(spec.num_shards) : {
@@ -24,6 +33,12 @@ resource "mongodbatlas_advanced_cluster" "dynamic_replication_specs" {
2433
}
2534
]
2635
])
36+
tags = merge(
37+
var.tags,
38+
{
39+
"Tag 2" = "Value 2"
40+
}
41+
)
2742

2843
# Updated by atlas-cli-plugin-terraform, please review the changes.
2944
}

0 commit comments

Comments
 (0)