-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvpc.tf
More file actions
38 lines (29 loc) · 1021 Bytes
/
vpc.tf
File metadata and controls
38 lines (29 loc) · 1021 Bytes
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
## VPC initialization
module "vpc" {
source = "terraform-aws-modules/vpc/aws"
version = "~> 5.0"
name = var.cluster_name
cidr = var.vpc_cidr
azs = var.vpc_azs
private_subnets = var.private_subnets
public_subnets = var.public_subnets
database_subnets = var.database_subnets
elasticache_subnets = var.elasticache_subnets
enable_nat_gateway = true
single_nat_gateway = true
enable_dns_hostnames = true
create_database_subnet_group = true
create_elasticache_subnet_group = true
enable_flow_log = var.enable_flow_log
create_flow_log_cloudwatch_iam_role = var.enable_flow_log
create_flow_log_cloudwatch_log_group = var.enable_flow_log
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
}
tags = local.tags
}