From 138122cd527ad6f8bbac632de88dcea75cd245a6 Mon Sep 17 00:00:00 2001 From: Suresh Kumar Nalluru Date: Thu, 28 Jan 2021 14:14:53 -0800 Subject: [PATCH] feat: Add support for `service_ipv4_cidr` for the EKS cluster (#1139) --- README.md | 1 + cluster.tf | 4 ++++ variables.tf | 6 ++++++ 3 files changed, 11 insertions(+) diff --git a/README.md b/README.md index f46ba5cec8f..60fd7d47f19 100644 --- a/README.md +++ b/README.md @@ -184,6 +184,7 @@ MIT Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraform-a | cluster\_log\_retention\_in\_days | Number of days to retain log events. Default retention - 90 days. | `number` | `90` | no | | cluster\_name | Name of the EKS cluster. Also used as a prefix in names of related resources. | `string` | n/a | yes | | cluster\_security\_group\_id | If provided, the EKS cluster will be attached to this security group. If not given, a security group will be created with necessary ingress/egress to work with the workers | `string` | `""` | no | +| cluster\_service\_ipv4\_cidr | service ipv4 cidr for the kubernetes cluster | `string` | `null` | no | | cluster\_version | Kubernetes version to use for the EKS cluster. | `string` | n/a | yes | | config\_output\_path | Where to save the Kubectl config file (if `write_kubeconfig = true`). Assumed to be a directory if the value ends with a forward slash `/`. | `string` | `"./"` | no | | create\_eks | Controls if EKS resources should be created (it affects almost all resources) | `bool` | `true` | no | diff --git a/cluster.tf b/cluster.tf index abe4e3ecf15..53a696bdeee 100644 --- a/cluster.tf +++ b/cluster.tf @@ -22,6 +22,10 @@ resource "aws_eks_cluster" "this" { public_access_cidrs = var.cluster_endpoint_public_access_cidrs } + kubernetes_network_config { + service_ipv4_cidr = var.cluster_service_ipv4_cidr + } + timeouts { create = var.cluster_create_timeout delete = var.cluster_delete_timeout diff --git a/variables.tf b/variables.tf index 9ff70f9a990..56fa8e6b3c4 100644 --- a/variables.tf +++ b/variables.tf @@ -369,3 +369,9 @@ variable "fargate_pod_execution_role_name" { type = string default = null } + +variable "cluster_service_ipv4_cidr" { + description = "service ipv4 cidr for the kubernetes cluster" + type = string + default = null +}