From 55a957bc8f492083eb52a192b14491d981d52f3f Mon Sep 17 00:00:00 2001 From: Daniel Piddock <33028589+dpiddockcmp@users.noreply.github.com> Date: Fri, 14 Aug 2020 16:06:53 +0200 Subject: [PATCH] feat: Cluster version is now a required variable. (#972) BREAKING CHANGES: `cluster_version` variable is now required. --- README.md | 2 +- examples/basic/main.tf | 7 ++++--- examples/create_false/main.tf | 5 +++-- examples/irsa/main.tf | 11 ++++++----- examples/launch_templates/main.tf | 9 +++++---- examples/managed_node_groups/main.tf | 7 ++++--- examples/secrets_encryption/main.tf | 7 ++++--- examples/spot_instances/main.tf | 9 +++++---- variables.tf | 1 - 9 files changed, 32 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 87e9e81295c..ec1d0d8ff69 100644 --- a/README.md +++ b/README.md @@ -172,7 +172,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\_version | Kubernetes version to use for the EKS cluster. | `string` | `"1.16"` | 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 | | create\_fargate\_pod\_execution\_role | Controls if the EKS Fargate pod execution IAM role should be created. | `bool` | `false` | no | diff --git a/examples/basic/main.tf b/examples/basic/main.tf index 4ce49b95b93..8c86e97ac66 100644 --- a/examples/basic/main.tf +++ b/examples/basic/main.tf @@ -123,9 +123,10 @@ module "vpc" { } module "eks" { - source = "../.." - cluster_name = local.cluster_name - subnets = module.vpc.private_subnets + source = "../.." + cluster_name = local.cluster_name + cluster_version = "1.17" + subnets = module.vpc.private_subnets tags = { Environment = "test" diff --git a/examples/create_false/main.tf b/examples/create_false/main.tf index 86604aacdd0..0aa61ef9591 100644 --- a/examples/create_false/main.tf +++ b/examples/create_false/main.tf @@ -21,8 +21,9 @@ provider "kubernetes" { } module "eks" { - source = "../.." - create_eks = false + source = "../.." + create_eks = false + cluster_version = "" vpc_id = "" cluster_name = "" diff --git a/examples/irsa/main.tf b/examples/irsa/main.tf index 849db9c28f1..2c26bd1b828 100644 --- a/examples/irsa/main.tf +++ b/examples/irsa/main.tf @@ -55,11 +55,12 @@ module "vpc" { } module "eks" { - source = "../.." - cluster_name = local.cluster_name - subnets = module.vpc.public_subnets - vpc_id = module.vpc.vpc_id - enable_irsa = true + source = "../.." + cluster_name = local.cluster_name + cluster_version = "1.17" + subnets = module.vpc.public_subnets + vpc_id = module.vpc.vpc_id + enable_irsa = true worker_groups = [ { diff --git a/examples/launch_templates/main.tf b/examples/launch_templates/main.tf index d76a13c561b..01db32dc5aa 100644 --- a/examples/launch_templates/main.tf +++ b/examples/launch_templates/main.tf @@ -63,10 +63,11 @@ module "vpc" { } module "eks" { - source = "../.." - cluster_name = local.cluster_name - subnets = module.vpc.public_subnets - vpc_id = module.vpc.vpc_id + source = "../.." + cluster_name = local.cluster_name + cluster_version = "1.17" + subnets = module.vpc.public_subnets + vpc_id = module.vpc.vpc_id worker_groups_launch_template = [ { diff --git a/examples/managed_node_groups/main.tf b/examples/managed_node_groups/main.tf index eed19c24ff1..a9cbbb6b524 100644 --- a/examples/managed_node_groups/main.tf +++ b/examples/managed_node_groups/main.tf @@ -76,9 +76,10 @@ module "vpc" { } module "eks" { - source = "../.." - cluster_name = local.cluster_name - subnets = module.vpc.private_subnets + source = "../.." + cluster_name = local.cluster_name + cluster_version = "1.17" + subnets = module.vpc.private_subnets tags = { Environment = "test" diff --git a/examples/secrets_encryption/main.tf b/examples/secrets_encryption/main.tf index 1a639e1d20a..acb233ec50f 100644 --- a/examples/secrets_encryption/main.tf +++ b/examples/secrets_encryption/main.tf @@ -80,9 +80,10 @@ module "vpc" { } module "eks" { - source = "../.." - cluster_name = local.cluster_name - subnets = module.vpc.private_subnets + source = "../.." + cluster_name = local.cluster_name + cluster_version = "1.17" + subnets = module.vpc.private_subnets cluster_encryption_config = [ { diff --git a/examples/spot_instances/main.tf b/examples/spot_instances/main.tf index 5406f1d234e..c52a1fc79cb 100644 --- a/examples/spot_instances/main.tf +++ b/examples/spot_instances/main.tf @@ -63,10 +63,11 @@ module "vpc" { } module "eks" { - source = "../.." - cluster_name = local.cluster_name - subnets = module.vpc.public_subnets - vpc_id = module.vpc.vpc_id + source = "../.." + cluster_name = local.cluster_name + cluster_version = "1.17" + subnets = module.vpc.public_subnets + vpc_id = module.vpc.vpc_id worker_groups_launch_template = [ { diff --git a/variables.tf b/variables.tf index 6a59161c2b1..8cf6aeead37 100644 --- a/variables.tf +++ b/variables.tf @@ -28,7 +28,6 @@ variable "cluster_security_group_id" { variable "cluster_version" { description = "Kubernetes version to use for the EKS cluster." type = string - default = "1.16" } variable "config_output_path" {