-
Notifications
You must be signed in to change notification settings - Fork 12
/
eks.tf
40 lines (35 loc) · 1.14 KB
/
eks.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
data "aws_eks_cluster" "cluster" {
name = module.eks.cluster_id
}
data "aws_eks_cluster_auth" "cluster" {
name = module.eks.cluster_id
}
provider "kubernetes" {
host = data.aws_eks_cluster.cluster.endpoint
cluster_ca_certificate = base64decode(data.aws_eks_cluster.cluster.certificate_authority.0.data)
token = data.aws_eks_cluster_auth.cluster.token
}
module "eks" {
source = "terraform-aws-modules/eks/aws"
version = "18.26.6"
manage_aws_auth_configmap = true
cluster_name = var.project_name
cluster_version = var.cluster_version
subnet_ids = module.vpc.private_subnets
vpc_id = module.vpc.vpc_id
cluster_enabled_log_types = var.cluster_enabled_log_types
cluster_encryption_config = [
{
provider_key_arn = aws_kms_key.eks.arn
resources = ["secrets"]
}
]
eks_managed_node_groups = {
worker = {
min_size = var.cluster_asg_min_size
max_size = var.cluster_asg_max_size
desired_size = var.cluster_asg_desired_capacity
instance_types = [var.cluster_instance_type]
}
}
}