-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathmain.tf
More file actions
33 lines (26 loc) · 745 Bytes
/
main.tf
File metadata and controls
33 lines (26 loc) · 745 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
module "vpc" {
source = "terraform-aws-modules/vpc/aws"
name = "eks-vpc-dev"
cidr = "10.0.0.0/16"
azs = ["ap-northeast-2a", "ap-northeast-2b", "ap-northeast-2c"]
public_subnets = ["10.0.0.0/20", "10.0.16.0/20", "10.0.32.0/20"]
private_subnets = ["10.0.48.0/20", "10.0.64.0/20", "10.0.80.0/20"]
enable_nat_gateway = true
enable_vpn_gateway = true
public_subnet_tags = {
"kubernetes.io/role/elb" = "1"
}
private_subnet_tags = {
"kubernetes.io/role/internal-elb" = "1"
}
tags = {
Terraform = "true"
Environment = "dev"
}
}
output "vpc_id" {
value = try(module.vpc.vpc_id, "")
}
output "private_subnets" {
value = try(module.vpc.aws_subnet.private[*].id, "")
}