Skip to content

Commit 482be0b

Browse files
authored
make requester vpc lookup optional if vpc is passed (#1099)
1 parent fedec4f commit 482be0b

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

modules/vpc-peering/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
locals {
22
enabled = module.this.enabled
33

4-
requester_vpc_id = coalesce(var.requester_vpc_id, module.requester_vpc.outputs.vpc_id)
4+
requester_vpc_id = coalesce(var.requester_vpc_id, one(module.requester_vpc[*].outputs.vpc_id))
55

66
accepter_aws_assume_role_arn = var.accepter_stage_name != null ? module.iam_roles.terraform_role_arns[var.accepter_stage_name] : var.accepter_aws_assume_role_arn
77
}

modules/vpc-peering/remote-state.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
module "requester_vpc" {
2+
count = var.requester_vpc_id == null ? 1 : 0
3+
24
source = "cloudposse/stack-config/yaml//modules/remote-state"
35
version = "1.5.0"
46

0 commit comments

Comments
 (0)