Skip to content

Commit

Permalink
make requester vpc lookup optional if vpc is passed (#1099)
Browse files Browse the repository at this point in the history
  • Loading branch information
Benbentwo authored Aug 15, 2024
1 parent fedec4f commit 482be0b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion modules/vpc-peering/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
locals {
enabled = module.this.enabled

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

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
}
Expand Down
2 changes: 2 additions & 0 deletions modules/vpc-peering/remote-state.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
module "requester_vpc" {
count = var.requester_vpc_id == null ? 1 : 0

source = "cloudposse/stack-config/yaml//modules/remote-state"
version = "1.5.0"

Expand Down

0 comments on commit 482be0b

Please sign in to comment.