Skip to content

Instantly share code, notes, and snippets.

@rmalenko
Created February 28, 2022 16:04
Show Gist options
  • Save rmalenko/16eeb30dd24ea0576140ac50af0fb6f6 to your computer and use it in GitHub Desktop.
Save rmalenko/16eeb30dd24ea0576140ac50af0fb6f6 to your computer and use it in GitHub Desktop.
module "eks" {
source = "../modules/terraform-aws-eks"
cluster_name = local.cluster_name
cluster_version = local.cluster_version
cluster_endpoint_private_access = true
cluster_endpoint_public_access = true
cluster_ip_family = "ipv6"
vpc_id = local.vpc_id
subnet_ids = local.private_subnets
cluster_addons = {
coredns = {
resolve_conflicts = "OVERWRITE"
}
kube-proxy = {}
vpc-cni = {
resolve_conflicts = "OVERWRITE"
service_account_role_arn = module.vpc_cni_irsa.iam_role_arn
}
}
eks_managed_node_group_defaults = {
ami_type = "AL2_x86_64"
key_name = aws_key_pair.key_rsa.id
disk_size = 25
instance_types = ["t2.micro"]
capacity_type = "SPOT"
}
eks_managed_node_groups = {
default_node_group = {
create_launch_template = false
launch_template_name = ""
}
}
tags = local.tags
}
module "vpc_cni_irsa" {
source = "../modules/terraform-aws-iam/modules/iam-role-for-service-accounts-eks"
role_name_prefix = "VPC-CNI-IRSA"
attach_vpc_cni_policy = true
vpc_cni_enable_ipv6 = true
oidc_providers = {
main = {
provider_arn = module.eks.oidc_provider_arn
namespace_service_accounts = ["kube-system:aws-node"]
}
}
tags = local.tags
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment