Skip to content
Closed
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: 0 additions & 4 deletions data/data/aws/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,6 @@ module "vpc" {
external_worker_subnet_ids = "${compact(var.tectonic_aws_external_worker_subnet_ids)}"
extra_tags = "${var.tectonic_aws_extra_tags}"

// empty map subnet_configs will have the vpc module creating subnets in all availabile AZs
new_master_subnet_configs = "${var.tectonic_aws_master_custom_subnets}"
new_worker_subnet_configs = "${var.tectonic_aws_worker_custom_subnets}"

private_master_endpoints = "${local.private_endpoints}"
public_master_endpoints = "${local.public_endpoints}"
}
Expand Down
23 changes: 0 additions & 23 deletions data/data/aws/variables-aws.tf
Original file line number Diff line number Diff line change
Expand Up @@ -171,29 +171,6 @@ Ignored if the volume type is not io1.
EOF
}

variable "tectonic_aws_master_custom_subnets" {
type = "map"
default = {}

description = <<EOF
(optional) This configures master availability zones and their corresponding subnet CIDRs directly.

Example:
`{ eu-west-1a = "10.0.0.0/20", eu-west-1b = "10.0.16.0/20" }`
EOF
}

variable "tectonic_aws_worker_custom_subnets" {
type = "map"
default = {}

description = <<EOF
(optional) This configures worker availability zones and their corresponding subnet CIDRs directly.

Example: `{ eu-west-1a = "10.0.64.0/20", eu-west-1b = "10.0.80.0/20" }`
EOF
}

variable "tectonic_aws_region" {
type = "string"
description = "The target AWS region for the cluster."
Expand Down
4 changes: 2 additions & 2 deletions data/data/aws/vpc/common.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ locals {
external_vpc_mode = "${var.external_vpc_id != ""}"

// List of possible AZs for each type of subnet
new_worker_subnet_azs = ["${coalescelist(keys(var.new_worker_subnet_configs), data.aws_availability_zones.azs.names)}"]
new_master_subnet_azs = ["${coalescelist(keys(var.new_master_subnet_configs), data.aws_availability_zones.azs.names)}"]
new_worker_subnet_azs = ["${data.aws_availability_zones.azs.names}"]
new_master_subnet_azs = ["${data.aws_availability_zones.azs.names}"]

// How many AZs to create worker and master subnets in (always zero if external_vpc_mode)
new_worker_az_count = "${local.external_vpc_mode ? 0 : length(local.new_worker_subnet_azs)}"
Expand Down
10 changes: 0 additions & 10 deletions data/data/aws/vpc/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,6 @@ variable "extra_tags" {
default = {}
}

variable "new_master_subnet_configs" {
description = "{az_name = new_subnet_cidr}: Empty map means create new subnets in all availability zones in region with generated cidrs"
type = "map"
}

variable "new_worker_subnet_configs" {
description = "{az_name = new_subnet_cidr}: Empty map means create new subnets in all availability zones in region with generated cidrs"
type = "map"
}

variable "private_master_endpoints" {
description = "If set to true, private-facing ingress resources are created."
default = true
Expand Down
5 changes: 1 addition & 4 deletions data/data/aws/vpc/vpc-private.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ resource "aws_subnet" "worker_subnet" {

vpc_id = "${data.aws_vpc.cluster_vpc.id}"

cidr_block = "${lookup(var.new_worker_subnet_configs,
local.new_worker_subnet_azs[count.index],
cidrsubnet(local.new_worker_cidr_range, 3, count.index),
)}"
cidr_block = "${cidrsubnet(local.new_worker_cidr_range, 3, count.index)}"

availability_zone = "${local.new_worker_subnet_azs[count.index]}"

Expand Down
5 changes: 1 addition & 4 deletions data/data/aws/vpc/vpc-public.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,7 @@ resource "aws_subnet" "master_subnet" {
count = "${local.new_master_az_count}"
vpc_id = "${data.aws_vpc.cluster_vpc.id}"

cidr_block = "${lookup(var.new_master_subnet_configs,
local.new_master_subnet_azs[count.index],
cidrsubnet(local.new_master_cidr_range, 3, count.index),
)}"
cidr_block = "${cidrsubnet(local.new_master_cidr_range, 3, count.index)}"

availability_zone = "${local.new_master_subnet_azs[count.index]}"

Expand Down
16 changes: 7 additions & 9 deletions pkg/tfvars/aws/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,9 @@ type External struct {

// Master converts master related config.
type Master struct {
CustomSubnets map[string]string `json:"tectonic_aws_master_custom_subnets,omitempty"`
EC2Type string `json:"tectonic_aws_master_ec2_type,omitempty"`
ExtraSGIDs []string `json:"tectonic_aws_master_extra_sg_ids,omitempty"`
IAMRoleName string `json:"tectonic_aws_master_iam_role_name,omitempty"`
EC2Type string `json:"tectonic_aws_master_ec2_type,omitempty"`
ExtraSGIDs []string `json:"tectonic_aws_master_extra_sg_ids,omitempty"`
IAMRoleName string `json:"tectonic_aws_master_iam_role_name,omitempty"`
MasterRootVolume `json:",inline"`
}

Expand All @@ -55,11 +54,10 @@ type MasterRootVolume struct {

// Worker converts worker related config.
type Worker struct {
CustomSubnets map[string]string `json:"tectonic_aws_worker_custom_subnets,omitempty"`
EC2Type string `json:"tectonic_aws_worker_ec2_type,omitempty"`
ExtraSGIDs []string `json:"tectonic_aws_worker_extra_sg_ids,omitempty"`
IAMRoleName string `json:"tectonic_aws_worker_iam_role_name,omitempty"`
LoadBalancers []string `json:"tectonic_aws_worker_load_balancers,omitempty"`
EC2Type string `json:"tectonic_aws_worker_ec2_type,omitempty"`
ExtraSGIDs []string `json:"tectonic_aws_worker_extra_sg_ids,omitempty"`
IAMRoleName string `json:"tectonic_aws_worker_iam_role_name,omitempty"`
LoadBalancers []string `json:"tectonic_aws_worker_load_balancers,omitempty"`
WorkerRootVolume `json:",inline"`
}

Expand Down