-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1_vpc.tf
61 lines (49 loc) · 1.49 KB
/
1_vpc.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
54
55
56
57
58
59
60
61
data "aws_availability_zones" "available" {
filter {
name = "opt-in-status"
values = ["opt-in-not-required"]
}
}
locals {
cluster_name = "aep-eks-${var.environment}"
}
module "vpc" {
source = "terraform-aws-modules/vpc/aws"
version = "5.0.0"
name = "education-vpc"
cidr = "10.0.0.0/16"
azs = slice(data.aws_availability_zones.available.names, 0, 3)
private_subnets = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"]
public_subnets = ["10.0.4.0/24", "10.0.5.0/24", "10.0.6.0/24"]
enable_nat_gateway = true
single_nat_gateway = true
enable_dns_hostnames = true
public_subnet_tags = {
"kubernetes.io/cluster/${local.cluster_name}" = "shared"
"kubernetes.io/role/elb" = 1
}
private_subnet_tags = {
"kubernetes.io/cluster/${local.cluster_name}" = "shared"
"kubernetes.io/role/internal-elb" = 1
}
}
output "vpc_id" {
description = "vpn id"
value = module.vpc.vpc_id
}
output "public_subnet_ids" {
description = "List of IDs of the public subnets"
value = module.vpc.public_subnets
}
output "private_subnet_ids" {
description = "List of IDs of the private subnets"
value = module.vpc.private_subnets
}
output "public_subnet_cidrs" {
description = "List of CIDR blocks of the public subnets"
value = module.vpc.public_subnets_cidr_blocks
}
output "private_subnet_cidrs" {
description = "List of CIDR blocks of the private subnets"
value = module.vpc.private_subnets_cidr_blocks
}