Skip to content

Commit f169ec9

Browse files
authored
chore: Adding integration coverage for expanded dependencies
1 parent 7ac5e1b commit f169ec9

20 files changed

Lines changed: 280 additions & 0 deletions

File tree

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
variable "vpc_id" {
2+
type = string
3+
}
4+
5+
variable "web_id" {
6+
type = string
7+
}
8+
9+
variable "api_id" {
10+
type = string
11+
}
12+
13+
variable "shard_first" {
14+
type = string
15+
}
16+
17+
variable "shard_second" {
18+
type = string
19+
}
20+
21+
output "vpc_id" {
22+
value = var.vpc_id
23+
}
24+
25+
output "web_id" {
26+
value = var.web_id
27+
}
28+
29+
output "api_id" {
30+
value = var.api_id
31+
}
32+
33+
output "shard_first" {
34+
value = var.shard_first
35+
}
36+
37+
output "shard_second" {
38+
value = var.shard_second
39+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
dependency "vpc" {
2+
config_path = "../vpc"
3+
}
4+
5+
dependency "aurora" {
6+
expansion {
7+
for_each = toset(["web", "api"])
8+
}
9+
10+
config_path = "../aurora-${each.key}"
11+
}
12+
13+
dependency "shard" {
14+
expansion {
15+
count = 2
16+
}
17+
18+
config_path = "../shard-${count.index}"
19+
}
20+
21+
inputs = {
22+
vpc_id = dependency.vpc.outputs.id
23+
web_id = dependency.aurora["web"].outputs.id
24+
api_id = dependency.aurora["api"].outputs.id
25+
shard_first = dependency.shard["0"].outputs.id
26+
shard_second = dependency.shard["1"].outputs.id
27+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
output "id" {
2+
value = "aurora-api-id"
3+
}

test/fixtures/dependency-expansion/keyed/aurora-api/terragrunt.hcl

Whitespace-only changes.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
output "id" {
2+
value = "aurora-web-id"
3+
}

test/fixtures/dependency-expansion/keyed/aurora-web/terragrunt.hcl

Whitespace-only changes.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
output "id" {
2+
value = "shard-0-id"
3+
}

test/fixtures/dependency-expansion/keyed/shard-0/terragrunt.hcl

Whitespace-only changes.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
output "id" {
2+
value = "shard-1-id"
3+
}

test/fixtures/dependency-expansion/keyed/shard-1/terragrunt.hcl

Whitespace-only changes.

0 commit comments

Comments
 (0)