-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.tf
53 lines (42 loc) · 1.59 KB
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
provider "aws" {
region = var.aws_region
skip_credentials_validation = true
skip_requesting_account_id = true
skip_metadata_api_check = true
s3_force_path_style = true
access_key = "mock_access_key"
secret_key = "mock_secret_key"
}
module "vpc" {
source = "terraform-aws-modules/vpc/aws"
version = "3.7.0"
name = var.environment_name
cidr = var.vpc_cidr
secondary_cidr_blocks = var.secondary_cidrs
azs = var.azs
private_subnets = var.private_subnets
public_subnets = var.public_subnets
# We want to use the 100.64.0.0/16 address space for the EKS nodes and since
# this module doesnt have an EKS subnet, we will use the elasticache instead.
elasticache_subnets = var.k8s_worker_subnets
enable_nat_gateway = var.enable_nat_gateway
reuse_nat_ips = var.reuse_nat_ips
external_nat_ip_ids = var.external_nat_ip_ids
enable_vpn_gateway = var.enable_vpn_gateway
enable_dns_hostnames = var.enable_dns_hostnames
enable_dns_support = var.enable_dns_support
public_subnet_tags = {
"kubernetes.io/cluster/${var.cluster_name}" = "shared"
"kubernetes.io/role/elb" = "1"
}
private_subnet_tags = {
"kubernetes.io/cluster/${var.cluster_name}" = "shared"
"kubernetes.io/role/internal-elb" = "1"
}
elasticache_subnet_tags = {
"kubernetes.io/cluster/${var.cluster_name}" = "shared"
"kubernetes.io/role/internal-elb" = "1"
"ops_purpose" = "Overloaded for k8s worker usage"
}
tags = var.tags
}