Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use vpc tags to get vpc id #219

Closed
wants to merge 6 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
@@ -13,8 +13,7 @@ locals {
# The RFC 6052 "well known" NAT64 CIDR
nat64_cidr = "64:ff9b::/96"

# In case we later decide to compute it
vpc_id = var.vpc_id
vpc_id = one(data.aws_vpc.default[*].id)

#####################################################################
## Determine the set of availability zones in which to deploy subnets
@@ -271,7 +270,9 @@ data "aws_availability_zones" "default" {
data "aws_vpc" "default" {
count = local.need_vpc_data ? 1 : 0

id = local.vpc_id
id = var.vpc_id

tags = var.vpc_id
}

data "aws_eip" "nat" {
7 changes: 7 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
variable "vpc_id" {
type = string
description = "VPC ID where subnets will be created (e.g. `vpc-aceb2723`)"
default = null
}

variable "vpc_tags" {

Check warning on line 7 in variables.tf

GitHub Actions / terraform-module / CI / Lint (.)

[tflint] reported by reviewdog 🐶 variable "vpc_tags" is declared but not used Raw Output: variables.tf:7:1: warning: variable "vpc_tags" is declared but not used ()

Check warning on line 7 in variables.tf

GitHub Actions / terraform-module / CI / Lint (.)

[tflint] reported by reviewdog 🐶 variable "vpc_tags" is declared but not used Raw Output: variables.tf:7:1: warning: variable "vpc_tags" is declared but not used ()
type = map(string)
description = "VPC tags to get the VPC ID where subnets will be created"
default = null
}

variable "igw_id" {
Loading