-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
65 lines (56 loc) · 2.22 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
54
55
56
57
58
59
60
61
62
63
64
65
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
module "networking" {
source = "./networking"
region = var.region
project_name = var.project_name
}
module "ec2_jenkins" {
source = "./instances/ec2_jenkins"
region = var.region
project_name = var.project_name
netmod_my_vpc_id = module.networking.my_vpc_id
netmod_jenkins_sg_id = module.networking.jenkins_sg_id
netmod_jenkins_sub_id = module.networking.jenkins_sub_id
}
module "eks_self_managed_cluster" {
source = "./eks"
region = var.region
project_name = var.project_name
###############################################
# BEGINS: EKS NAT & Subnet Setup Variables
# 1-networking_subnets.tf, 2-networking_nat.tf, 3-networking_route_tables.tf
###############################################
# Prerquisites: You need to have already deployed a module that provides you a VPC ID and Internet Gateway ID
target_vpc_id = module.networking.my_vpc_id
target_igw_id = module.networking.igw_id
azs = ["${var.region}a", "${var.region}b"]
# Define to subnet IP ranges (at least 4)
subnets_eks_private = ["10.1.32.0/19", "10.1.64.0/19"]
subnets_eks_public = ["10.1.96.0/19", "10.1.128.0/19"]
tags_subnets_eks_private = {
"kubernetes.io/role/internal-elb" = 1
"kubernetes.io/cluster/my-eks" = "owned"
}
tags_subnets_eks_public = {
"kubernetes.io/role/internal-elb" = 1
"kubernetes.io/cluster/my-eks" = "owned"
}
###############################################
# ENDS: EKS NAT & Subnet Setup Variables
###############################################
###############################################
# BEGINS: EKS Cluster Variables
###############################################
cluster_name = "${var.project_name}-eks-cluster"
###############################################
# ENDS: EKS Cluster Variables
###############################################
###############################################
# BEGINS: OpenID Provider
###############################################
enable_irsa = true
###############################################
# ENDS: OpenID Provider
###############################################
}