{"id":51018849,"url":"https://github.com/native-cube/terraform-aws-eks","last_synced_at":"2026-06-21T14:30:41.240Z","repository":{"id":365024503,"uuid":"1270188376","full_name":"native-cube/terraform-aws-eks","owner":"native-cube","description":null,"archived":false,"fork":false,"pushed_at":"2026-06-15T14:14:14.000Z","size":36,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-15T15:24:28.761Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/native-cube.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null},"funding":{"github":["marcincuber"],"custom":"https://www.paypal.me/marcincube"}},"created_at":"2026-06-15T13:22:18.000Z","updated_at":"2026-06-15T14:15:02.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/native-cube/terraform-aws-eks","commit_stats":null,"previous_names":["native-cube/terraform-aws-eks"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/native-cube/terraform-aws-eks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/native-cube%2Fterraform-aws-eks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/native-cube%2Fterraform-aws-eks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/native-cube%2Fterraform-aws-eks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/native-cube%2Fterraform-aws-eks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/native-cube","download_url":"https://codeload.github.com/native-cube/terraform-aws-eks/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/native-cube%2Fterraform-aws-eks/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34511617,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-18T02:00:06.871Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-21T14:30:40.528Z","updated_at":"2026-06-21T14:30:41.233Z","avatar_url":"https://github.com/native-cube.png","language":"HCL","funding_links":["https://github.com/sponsors/marcincuber","https://www.paypal.me/marcincube"],"categories":[],"sub_categories":[],"readme":"# Terraform AWS EKS Module\n\nSimple Terraform module for creating an Amazon EKS cluster with:\n\n- EKS control plane IAM role\n- Managed node group IAM role\n- One or more EKS managed node groups\n- Core EKS add-ons: `coredns`, `kube-proxy`, and `vpc-cni`\n- Optional EKS-side Karpenter readiness without installing Karpenter itself\n- Useful connection and composition outputs\n\nThe module expects you to provide existing subnet IDs. In most deployments these should be private subnets with outbound internet access through NAT.\n\n## Usage\n\n```hcl\nmodule \"eks\" {\n  source = \"./eks\"\n\n  name         = \"dev\"\n  cluster_name = \"dev-eks\"\n  subnet_ids   = [\"subnet-0123456789abcdef0\", \"subnet-0fedcba9876543210\"]\n\n  node_groups = {\n    default = {\n      instance_types = [\"t3.medium\"]\n      min_size       = 1\n      desired_size   = 2\n      max_size       = 3\n    }\n  }\n\n  tags = {\n    Environment = \"dev\"\n  }\n}\n```\n\nThen configure `kubectl`:\n\n```bash\naws eks update-kubeconfig --name dev-eks\n```\n\n## Examples\n\n- `examples/minimal` - smallest practical module call using defaults for node groups, add-ons, API access, and logging.\n- `examples/basic` - simple explicit managed node group configuration.\n- `examples/advanced` - restricted API access, full control-plane logging, multiple node groups, expanded add-on configuration, optional IAM-backed add-ons, and optional node subnet overrides.\n- `examples/karpenter-ready` - EKS-side Karpenter readiness with discovery tags, a Karpenter node role, and node access entry while leaving the Karpenter controller, Helm release, interruption queue, NodePool, and EC2NodeClass to a separate module.\n\n## Karpenter Readiness\n\nEnable the `karpenter` object when this module should prepare the cluster for Karpenter-managed capacity:\n\n```hcl\nmodule \"eks\" {\n  source = \"./eks\"\n\n  name       = \"dev\"\n  subnet_ids = [\"subnet-0123456789abcdef0\", \"subnet-0fedcba9876543210\"]\n\n  karpenter = {\n    enabled              = true\n    create_node_iam_role = true\n    create_access_entry  = true\n  }\n}\n```\n\nWhen enabled, the module can create the worker-node IAM role used by Karpenter-launched EC2 instances, authorize that role with an EKS `EC2_LINUX` access entry, and tag selected subnets plus the EKS-created cluster security group with `karpenter.sh/discovery = \u003ccluster_name\u003e`.\n\nThis module deliberately does not install the Karpenter controller, create its controller IAM role, create an interruption queue, or manage `NodePool` and `EC2NodeClass` resources. Use the `karpenter_*` outputs as inputs to that separate layer.\n\n## Module Documentation\n\n\u003c!-- BEGIN_TF_DOCS --\u003e\n## Requirements\n\n| Name | Version |\n| ---- | ------- |\n| \u003ca name=\"requirement_terraform\"\u003e\u003c/a\u003e [terraform](#requirement\\_terraform) | \u003e= 1.5.0 |\n| \u003ca name=\"requirement_aws\"\u003e\u003c/a\u003e [aws](#requirement\\_aws) | \u003e= 6.0 |\n\n## Providers\n\n| Name | Version |\n| ---- | ------- |\n| \u003ca name=\"provider_aws\"\u003e\u003c/a\u003e [aws](#provider\\_aws) | \u003e= 6.0 |\n\n## Resources\n\n| Name | Type |\n| ---- | ---- |\n| [aws_cloudwatch_log_group.cluster](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_log_group) | resource |\n| [aws_ec2_tag.karpenter_cluster_security_group](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ec2_tag) | resource |\n| [aws_ec2_tag.karpenter_subnets](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ec2_tag) | resource |\n| [aws_eks_access_entry.karpenter_node](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/eks_access_entry) | resource |\n| [aws_eks_addon.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/eks_addon) | resource |\n| [aws_eks_cluster.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/eks_cluster) | resource |\n| [aws_eks_node_group.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/eks_node_group) | resource |\n| [aws_iam_role.cluster](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource |\n| [aws_iam_role.karpenter_node](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource |\n| [aws_iam_role.node](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource |\n| [aws_iam_role_policy_attachment.cluster](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource |\n| [aws_iam_role_policy_attachment.karpenter_node](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource |\n| [aws_iam_role_policy_attachment.node](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource |\n\n## Inputs\n\n| Name | Description | Type | Default | Required |\n| ---- | ----------- | ---- | ------- | :------: |\n| \u003ca name=\"input_access_config\"\u003e\u003c/a\u003e [access\\_config](#input\\_access\\_config) | Optional EKS access configuration for cluster authentication mode and creator admin permissions. | \u003cpre\u003eobject({\u003cbr/\u003e    authentication_mode                         = optional(string)\u003cbr/\u003e    bootstrap_cluster_creator_admin_permissions = optional(bool)\u003cbr/\u003e  })\u003c/pre\u003e | `null` | no |\n| \u003ca name=\"input_addons\"\u003e\u003c/a\u003e [addons](#input\\_addons) | EKS add-ons to install after the managed node groups are created. | \u003cpre\u003emap(object({\u003cbr/\u003e    configuration_values = optional(string)\u003cbr/\u003e    pod_identity_associations = optional(list(object({\u003cbr/\u003e      role_arn        = string\u003cbr/\u003e      service_account = string\u003cbr/\u003e    })), [])\u003cbr/\u003e    resolve_conflicts_on_create = optional(string, \"OVERWRITE\")\u003cbr/\u003e    resolve_conflicts_on_update = optional(string, \"OVERWRITE\")\u003cbr/\u003e    service_account_role_arn    = optional(string)\u003cbr/\u003e    version                     = optional(string)\u003cbr/\u003e  }))\u003c/pre\u003e | \u003cpre\u003e{\u003cbr/\u003e  \"coredns\": {},\u003cbr/\u003e  \"kube-proxy\": {},\u003cbr/\u003e  \"vpc-cni\": {}\u003cbr/\u003e}\u003c/pre\u003e | no |\n| \u003ca name=\"input_cloudwatch_log_group_kms_key_id\"\u003e\u003c/a\u003e [cloudwatch\\_log\\_group\\_kms\\_key\\_id](#input\\_cloudwatch\\_log\\_group\\_kms\\_key\\_id) | Optional KMS key ID or ARN for encrypting the EKS control plane CloudWatch log group. | `string` | `null` | no |\n| \u003ca name=\"input_cloudwatch_log_retention_days\"\u003e\u003c/a\u003e [cloudwatch\\_log\\_retention\\_days](#input\\_cloudwatch\\_log\\_retention\\_days) | Retention in days for the EKS control plane CloudWatch log group. | `number` | `30` | no |\n| \u003ca name=\"input_cluster_encryption_config\"\u003e\u003c/a\u003e [cluster\\_encryption\\_config](#input\\_cluster\\_encryption\\_config) | Optional EKS encryption configuration for Kubernetes secrets using an existing KMS key. | \u003cpre\u003eobject({\u003cbr/\u003e    provider_key_arn = string\u003cbr/\u003e    resources        = optional(list(string), [\"secrets\"])\u003cbr/\u003e  })\u003c/pre\u003e | `null` | no |\n| \u003ca name=\"input_cluster_name\"\u003e\u003c/a\u003e [cluster\\_name](#input\\_cluster\\_name) | Optional EKS cluster name. When null, name is used as the cluster name. | `string` | `null` | no |\n| \u003ca name=\"input_cluster_security_group_ids\"\u003e\u003c/a\u003e [cluster\\_security\\_group\\_ids](#input\\_cluster\\_security\\_group\\_ids) | Additional security group IDs to associate with the EKS control plane. | `list(string)` | `[]` | no |\n| \u003ca name=\"input_deletion_protection\"\u003e\u003c/a\u003e [deletion\\_protection](#input\\_deletion\\_protection) | Whether to enable deletion protection for the EKS cluster. Leave null to use the AWS/provider default. | `bool` | `null` | no |\n| \u003ca name=\"input_enabled_cluster_log_types\"\u003e\u003c/a\u003e [enabled\\_cluster\\_log\\_types](#input\\_enabled\\_cluster\\_log\\_types) | EKS control plane log types to enable. | `list(string)` | \u003cpre\u003e[\u003cbr/\u003e  \"api\",\u003cbr/\u003e  \"audit\",\u003cbr/\u003e  \"authenticator\"\u003cbr/\u003e]\u003c/pre\u003e | no |\n| \u003ca name=\"input_endpoint_private_access\"\u003e\u003c/a\u003e [endpoint\\_private\\_access](#input\\_endpoint\\_private\\_access) | Whether the Kubernetes API server endpoint is reachable from within the VPC. | `bool` | `true` | no |\n| \u003ca name=\"input_endpoint_public_access\"\u003e\u003c/a\u003e [endpoint\\_public\\_access](#input\\_endpoint\\_public\\_access) | Whether the Kubernetes API server endpoint is reachable from the public internet. | `bool` | `true` | no |\n| \u003ca name=\"input_karpenter\"\u003e\u003c/a\u003e [karpenter](#input\\_karpenter) | Optional EKS-side readiness settings for Karpenter. This module prepares AWS/EKS primitives only; install Karpenter, controller IAM, interruption handling, NodePools, and EC2NodeClasses separately. | \u003cpre\u003eobject({\u003cbr/\u003e    create_access_entry        = optional(bool, true)\u003cbr/\u003e    create_node_iam_role       = optional(bool, true)\u003cbr/\u003e    enabled                    = optional(bool, false)\u003cbr/\u003e    node_iam_role_arn          = optional(string)\u003cbr/\u003e    node_iam_role_name         = optional(string)\u003cbr/\u003e    subnet_ids                 = optional(list(string), [])\u003cbr/\u003e    tag_cluster_security_group = optional(bool, true)\u003cbr/\u003e    tag_subnets                = optional(bool, true)\u003cbr/\u003e  })\u003c/pre\u003e | `{}` | no |\n| \u003ca name=\"input_kubernetes_version\"\u003e\u003c/a\u003e [kubernetes\\_version](#input\\_kubernetes\\_version) | Kubernetes version for the EKS cluster and managed node groups. Leave null to use the current AWS default. | `string` | `null` | no |\n| \u003ca name=\"input_name\"\u003e\u003c/a\u003e [name](#input\\_name) | Name prefix for module-created resources. Used as the EKS cluster name when cluster\\_name is null. | `string` | n/a | yes |\n| \u003ca name=\"input_node_groups\"\u003e\u003c/a\u003e [node\\_groups](#input\\_node\\_groups) | Managed node groups to create. | \u003cpre\u003emap(object({\u003cbr/\u003e    ami_type               = optional(string)\u003cbr/\u003e    capacity_type          = optional(string, \"ON_DEMAND\")\u003cbr/\u003e    desired_size           = optional(number, 2)\u003cbr/\u003e    disk_size              = optional(number, 20)\u003cbr/\u003e    instance_types         = optional(list(string), [\"t3.medium\"])\u003cbr/\u003e    labels                 = optional(map(string), {})\u003cbr/\u003e    max_size               = optional(number, 3)\u003cbr/\u003e    min_size               = optional(number, 1)\u003cbr/\u003e    subnet_ids             = optional(list(string), [])\u003cbr/\u003e    update_max_unavailable = optional(number, 1)\u003cbr/\u003e    node_repair_config = optional(object({\u003cbr/\u003e      enabled                                 = optional(bool)\u003cbr/\u003e      max_parallel_nodes_repaired_count       = optional(number)\u003cbr/\u003e      max_parallel_nodes_repaired_percentage  = optional(number)\u003cbr/\u003e      max_unhealthy_node_threshold_count      = optional(number)\u003cbr/\u003e      max_unhealthy_node_threshold_percentage = optional(number)\u003cbr/\u003e      overrides = optional(list(object({\u003cbr/\u003e        min_repair_wait_time_mins = number\u003cbr/\u003e        node_monitoring_condition = string\u003cbr/\u003e        node_unhealthy_reason     = string\u003cbr/\u003e        repair_action             = string\u003cbr/\u003e      })), [])\u003cbr/\u003e    }))\u003cbr/\u003e    taints = optional(list(object({\u003cbr/\u003e      effect = string\u003cbr/\u003e      key    = string\u003cbr/\u003e      value  = optional(string, \"\")\u003cbr/\u003e    })), [])\u003cbr/\u003e  }))\u003c/pre\u003e | \u003cpre\u003e{\u003cbr/\u003e  \"default\": {}\u003cbr/\u003e}\u003c/pre\u003e | no |\n| \u003ca name=\"input_public_access_cidrs\"\u003e\u003c/a\u003e [public\\_access\\_cidrs](#input\\_public\\_access\\_cidrs) | CIDR blocks that can access the public Kubernetes API endpoint. | `list(string)` | \u003cpre\u003e[\u003cbr/\u003e  \"0.0.0.0/0\"\u003cbr/\u003e]\u003c/pre\u003e | no |\n| \u003ca name=\"input_service_ipv4_cidr\"\u003e\u003c/a\u003e [service\\_ipv4\\_cidr](#input\\_service\\_ipv4\\_cidr) | Optional Kubernetes service IPv4 CIDR. Set only when you need a non-default service CIDR. | `string` | `null` | no |\n| \u003ca name=\"input_subnet_ids\"\u003e\u003c/a\u003e [subnet\\_ids](#input\\_subnet\\_ids) | Subnet IDs for the EKS control plane and default node groups. Use at least two subnets in different Availability Zones. | `list(string)` | n/a | yes |\n| \u003ca name=\"input_tags\"\u003e\u003c/a\u003e [tags](#input\\_tags) | Tags to apply to created resources. | `map(string)` | `{}` | no |\n\n## Outputs\n\n| Name | Description |\n| ---- | ----------- |\n| \u003ca name=\"output_addon_arns\"\u003e\u003c/a\u003e [addon\\_arns](#output\\_addon\\_arns) | EKS add-on ARNs by add-on name. |\n| \u003ca name=\"output_cluster_arn\"\u003e\u003c/a\u003e [cluster\\_arn](#output\\_cluster\\_arn) | EKS cluster ARN. |\n| \u003ca name=\"output_cluster_certificate_authority_data\"\u003e\u003c/a\u003e [cluster\\_certificate\\_authority\\_data](#output\\_cluster\\_certificate\\_authority\\_data) | Base64-encoded cluster certificate authority data. |\n| \u003ca name=\"output_cluster_endpoint\"\u003e\u003c/a\u003e [cluster\\_endpoint](#output\\_cluster\\_endpoint) | Kubernetes API server endpoint. |\n| \u003ca name=\"output_cluster_iam_role_arn\"\u003e\u003c/a\u003e [cluster\\_iam\\_role\\_arn](#output\\_cluster\\_iam\\_role\\_arn) | IAM role ARN used by the EKS control plane. |\n| \u003ca name=\"output_cluster_log_group_name\"\u003e\u003c/a\u003e [cluster\\_log\\_group\\_name](#output\\_cluster\\_log\\_group\\_name) | CloudWatch log group for EKS control plane logs, if cluster logs are enabled. |\n| \u003ca name=\"output_cluster_name\"\u003e\u003c/a\u003e [cluster\\_name](#output\\_cluster\\_name) | EKS cluster name. |\n| \u003ca name=\"output_cluster_oidc_issuer_url\"\u003e\u003c/a\u003e [cluster\\_oidc\\_issuer\\_url](#output\\_cluster\\_oidc\\_issuer\\_url) | OIDC issuer URL for the EKS cluster. |\n| \u003ca name=\"output_cluster_security_group_id\"\u003e\u003c/a\u003e [cluster\\_security\\_group\\_id](#output\\_cluster\\_security\\_group\\_id) | Security group created by EKS for the cluster. |\n| \u003ca name=\"output_karpenter_discovery_tag_key\"\u003e\u003c/a\u003e [karpenter\\_discovery\\_tag\\_key](#output\\_karpenter\\_discovery\\_tag\\_key) | Tag key used by Karpenter discovery selectors when Karpenter readiness is enabled. |\n| \u003ca name=\"output_karpenter_discovery_tag_value\"\u003e\u003c/a\u003e [karpenter\\_discovery\\_tag\\_value](#output\\_karpenter\\_discovery\\_tag\\_value) | Tag value used by Karpenter discovery selectors when Karpenter readiness is enabled. |\n| \u003ca name=\"output_karpenter_node_iam_role_arn\"\u003e\u003c/a\u003e [karpenter\\_node\\_iam\\_role\\_arn](#output\\_karpenter\\_node\\_iam\\_role\\_arn) | IAM role ARN for Karpenter-launched worker nodes when Karpenter readiness is enabled. |\n| \u003ca name=\"output_karpenter_node_iam_role_name\"\u003e\u003c/a\u003e [karpenter\\_node\\_iam\\_role\\_name](#output\\_karpenter\\_node\\_iam\\_role\\_name) | IAM role name for Karpenter EC2NodeClass role configuration when Karpenter readiness is enabled. |\n| \u003ca name=\"output_node_group_arns\"\u003e\u003c/a\u003e [node\\_group\\_arns](#output\\_node\\_group\\_arns) | Managed node group ARNs by node group key. |\n| \u003ca name=\"output_node_iam_role_arn\"\u003e\u003c/a\u003e [node\\_iam\\_role\\_arn](#output\\_node\\_iam\\_role\\_arn) | IAM role ARN used by managed node groups. |\n| \u003ca name=\"output_update_kubeconfig_command\"\u003e\u003c/a\u003e [update\\_kubeconfig\\_command](#output\\_update\\_kubeconfig\\_command) | AWS CLI command to configure kubectl for this cluster. |\n\u003c!-- END_TF_DOCS --\u003e\n\n## Git Hooks\n\nEnable the repository hooks after cloning or initializing Git:\n\n```bash\ngit config core.hooksPath .githooks\n```\n\nThe pre-commit hook checks Terraform formatting and verifies that generated Terraform docs in this README are up to date.\n\nRegenerate the README module documentation manually with:\n\n```bash\nscripts/terraform-docs.sh\n```\n\n## Tests\n\nNative Terraform tests live in `tests/` and use mocked AWS provider resources, so they can run without AWS credentials or creating infrastructure:\n\n```bash\nterraform test\n```\n\nPull requests run the same tests through `.github/workflows/terraform-pr.yml`, along with formatting, generated-docs, validation, and example checks.\n\n## Local Development\n\nUse the Makefile for common local checks:\n\n```bash\nmake fmt\nmake docs\nmake check\n```\n\n## Notes\n\n- The module does not create VPC, subnet, route table, NAT gateway, or security baseline resources.\n- For production use, restrict `public_access_cidrs` instead of leaving the default `0.0.0.0/0`.\n- Node group subnets default to `subnet_ids`, but each node group can override them with its own `subnet_ids`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnative-cube%2Fterraform-aws-eks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnative-cube%2Fterraform-aws-eks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnative-cube%2Fterraform-aws-eks/lists"}