Skip to content
This repository has been archived by the owner on Jan 25, 2023. It is now read-only.

Expose subnet_ids var to root module #236

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ module "consul_servers" {
})

vpc_id = data.aws_vpc.default.id
subnet_ids = data.aws_subnet_ids.default.ids
subnet_ids = var.subnet_ids != null ? var.subnet_ids : data.aws_subnet_ids.default.ids

# If set to true, this allows access to the consul HTTPS API
enable_https_port = var.enable_https_port
Expand Down Expand Up @@ -128,7 +128,7 @@ module "consul_clients" {
})

vpc_id = data.aws_vpc.default.id
subnet_ids = data.aws_subnet_ids.default.ids
subnet_ids = var.subnet_ids != null ? var.subnet_ids : data.aws_subnet_ids.default.ids

# To make testing easier, we allow Consul and SSH requests from any IP address here but in a production
# deployment, we strongly recommend you limit this to the IP address ranges of known, trusted servers inside your VPC.
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,9 @@ variable "enable_https_port" {
type = bool
default = false
}

variable "subnet_ids" {
description = "The subnet IDs into which the EC2 Instances should be deployed. We recommend one subnet ID per node in the cluster_size variable."
type = list(string)
default = null
}