From 236e187e04e64fcf696e39034f3fcfb820c801de Mon Sep 17 00:00:00 2001 From: Christian Vecchiola Date: Sat, 8 Jan 2022 17:14:25 +1100 Subject: [PATCH 1/2] fixed the version of the eks module to support current definition. --- demo-terraform-eks-cluster/eks-cluster.tf | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/demo-terraform-eks-cluster/eks-cluster.tf b/demo-terraform-eks-cluster/eks-cluster.tf index 666291c..ce7b3bd 100644 --- a/demo-terraform-eks-cluster/eks-cluster.tf +++ b/demo-terraform-eks-cluster/eks-cluster.tf @@ -2,6 +2,13 @@ module "eks" { source = "terraform-aws-modules/eks/aws" cluster_name = local.cluster_name cluster_version = "1.20" + + # this ensures that we can still use the properties + # `subnets`, `worker_groups_defaults` and `worker_groups` + # that since version 18.0.0 are no longer supported. + # + version = "17.24.0" + subnets = module.vpc.private_subnets tags = { From 8dc5493d2203e12d2bf806d0463d4984fbdb2ea0 Mon Sep 17 00:00:00 2001 From: Christian Vecchiola Date: Sat, 8 Jan 2022 17:53:01 +1100 Subject: [PATCH 2/2] modified to support the ability of specifying profiles for running infrastructure provisioning in AWS --- .../.terraform.lock.hcl | 86 +++++++++---------- demo-terraform-eks-cluster/aws.tf | 17 ++++ demo-terraform-eks-cluster/outputs.tf | 7 +- demo-terraform-eks-cluster/vpc.tf | 8 -- 4 files changed, 66 insertions(+), 52 deletions(-) create mode 100644 demo-terraform-eks-cluster/aws.tf diff --git a/demo-terraform-eks-cluster/.terraform.lock.hcl b/demo-terraform-eks-cluster/.terraform.lock.hcl index 1100936..0dc9c15 100644 --- a/demo-terraform-eks-cluster/.terraform.lock.hcl +++ b/demo-terraform-eks-cluster/.terraform.lock.hcl @@ -2,21 +2,21 @@ # Manual edits may be lost in future updates. provider "registry.terraform.io/hashicorp/aws" { - version = "3.42.0" - constraints = ">= 2.68.0, >= 3.20.0, >= 3.22.0, >= 3.37.0" + version = "3.71.0" + constraints = ">= 2.68.0, >= 3.20.0, >= 3.56.0" hashes = [ - "h1:C6/yDp6BhuDFx0qdkBuJj/OWUJpAoraHTJaU6ac38Rw=", - "zh:126c856a6eedddd8571f161a826a407ba5655a37a6241393560a96b8c4beca1a", - "zh:1a4868e6ac734b5fc2e79a4a889d176286b66664aad709435aa6acee5871d5b0", - "zh:40fed7637ab8ddeb93bef06aded35d970f0628025b97459ae805463e8aa0a58a", - "zh:68def3c0a5a1aac1db6372c51daef858b707f03052626d3427ac24cba6f2014d", - "zh:6db7ec9c8d1803a0b6f40a664aa892e0f8894562de83061fa7ac1bc51ff5e7e5", - "zh:7058abaad595930b3f97dc04e45c112b2dbf37d098372a849081f7081da2fb52", - "zh:8c25adb15a19da301c478aa1f4a4d8647cabdf8e5dae8331d4490f80ea718c26", - "zh:8e129b847401e39fcbc54817726dab877f36b7f00ff5ed76f7b43470abe99ff9", - "zh:d268bb267a2d6b39df7ddee8efa7c1ef7a15cf335dfa5f2e64c9dae9b623a1b8", - "zh:d6eeb3614a0ab50f8e9ab5666ae5754ea668ce327310e5b21b7f04a18d7611a8", - "zh:f5d3c58055dff6e38562b75d3edc908cb2f1e45c6914f6b00f4773359ce49324", + "h1:5+M8SPZlb3FxcmAX4RykKzNrTHkpjoP1UpHcenOXcxo=", + "zh:173134d8861a33ed60a48942ad2b96b9d06e85c506d7f927bead47a28f4ebdd2", + "zh:2996c8e96930f526f1761e99d14c0b18d83e287b1362aa2fa1444cf848ece613", + "zh:43903da1e0a809a1fb5832e957dbe2321b86630d6bfdd8b47728647a72fd912d", + "zh:43e71fd8924e7f7b56a0b2a82e29edf07c53c2b41ee7bb442a2f1c27e03e86ae", + "zh:4f4c73711f64a3ff85f88bf6b2594e5431d996b7a59041ff6cbc352f069fc122", + "zh:5045241b8695ffbd0730bdcd91393b10ffd0cfbeaad6254036e42ead6687d8fd", + "zh:6a8811a0fb1035c09aebf1f9b15295523a9a7a2627fd783f50c6168a82e192dd", + "zh:8d273c04d7a8c36d4366329adf041c480a0f1be10a7269269c88413300aebdb8", + "zh:b90505897ae4943a74de2b88b6a9e7d97bf6dc325a0222235996580edff28656", + "zh:ea5e422942ac6fc958229d27d4381c89d21d70c5c2c67a6c06ff357bcded76f6", + "zh:f1536d7ff2d3bfd668e3ac33d8956b4f988f87fdfdcc371c7d94b98d5dba53e2", ] } @@ -39,21 +39,21 @@ provider "registry.terraform.io/hashicorp/cloudinit" { } provider "registry.terraform.io/hashicorp/kubernetes" { - version = "2.2.0" + version = "2.7.1" constraints = ">= 1.11.1, >= 2.0.1" hashes = [ - "h1:iGRiQAggGI+k1uhlLhqbYQtAg3GYYO+0UP1aRjYvdaI=", - "zh:41be89f07c279425a146a31c2cca646efab65f4d5f0b8bbd6059761ff0446231", - "zh:4cbbb28396dc766bfca7ee2dbc19fa57331754eca7fee0fe57a87a73f5010f20", - "zh:5df93be3e696d60139a485a2937176739f05ac1884850bc58839c3ed99cff995", - "zh:64f01bcfc2ad1a42fbd307b9ceb7f70b3c19b35cdd0b950005190ec2de41083a", - "zh:7fc88030e20dd9560fd0e64c094d07d6f0c8d1db7838f77dc278f3cae93e7207", - "zh:81f7a855f1de2859c83565bc278869f6c7565b56d966fe9a4ef59fb55e5366d8", - "zh:d74811f3d3112ab52d151e1e1fa7fc9087d0ea5cc9ef72484c612780890ee586", - "zh:e93c93c43445855b4a75ec754b8c1579c55f95c23c1a33c188a57aa38357e513", - "zh:f67b32a26cbb763134f6294a2b95798d63aacc63532457c10dc779819f6d8ad0", - "zh:fb435298e7b0d8a021bdbfa496dd5c76c9eb0dada4b406b3439949bd4aef756a", - "zh:ffafbdea9766b89525c67886f6f0ee9992ae48a229c689716952d71a06b05107", + "h1:/zifejk3MfLSDQr5J6sc3EHrnFwAVEDH9LrewWMRqe4=", + "zh:0da320fd81ece6696f7cceda35e459ee97cae8955088af38fc7f2feab1dce924", + "zh:37d304b8b992518c9c12e8f10437b9d4a0cc5a823c9421ac794ad2347c4d1122", + "zh:3d4e12fb9588c3b2e782d392fea758c6982e5d653154bec951e949155bcbc169", + "zh:6bb32b8d5cccf3e3ae7c124ed27df76dc7653ca760c132addeee15272630c930", + "zh:94775153b90e285876fc17261e8f5338a1ff732f4133336cc68754acb74570b6", + "zh:a665d1336765cdf8620a8797fd4e7e3cecf789e96e59ba80634336a4390df377", + "zh:aa8b35e9958cb89f01c115e8866a07d5468fb53f1c227d673e94f7ee8fb76242", + "zh:b7a571336387d773a74ed6eefa3843ff78d3662f2745c99c95008002a1341662", + "zh:c50d661782175d50ea4952fe943b0e4a3e33c27aa69e5ff21b3cbfa513e90d0a", + "zh:e0999b349cc772c75876adbc2a13b5dc256d3ecd7e4aa91baee5fdfcecaa7465", + "zh:e1399aec06a7aa98e9b0f64b4281697247f338a8a40b79f5f6ebfd43bf4ce1e2", ] } @@ -130,22 +130,22 @@ provider "registry.terraform.io/hashicorp/template" { } provider "registry.terraform.io/terraform-aws-modules/http" { - version = "2.4.0" - constraints = ">= 2.4.0" + version = "2.4.1" + constraints = ">= 2.4.1" hashes = [ - "h1:YLDIXOsMLK2QwMff0s9LrmJOw8JYLgi/2+OwwH/FSiY=", - "zh:28530c6e1ff67cd0d769d9b657bf9b8e6b2d48dd5ee18962882484d0762ce023", - "zh:55d77f44f85c9bde7f22c86ad50dc64b9bfe05a8c53e510f536607259b815826", - "zh:5bd48a5f687353459cfa8728f4ef366cb0326157be168f34d0f22a4e811339a9", - "zh:5da63cf9e0d6a47f89f23b60776930c50fe31f96d1d6c8c416974679d8083f05", - "zh:6a9a34024fea6be19c7748f98f15a88acd972d55216fefee7f1208841963ef07", - "zh:7d7ffde9ef572ca4f8605f23c699a8695ebb54343fb34b5d85ea8cdb3a92c383", - "zh:8743280724624c1b97e1e48245a8354ea005f940816a2cc39cd2e9ce06a89390", - "zh:aa3f72176abff81bcc52cbbce53bde956691c119f5f14aa0ed8d7469fb29fa84", - "zh:ab3f6898fc08331690e42eceabe2ddc20d5eaf0a83bf0c6084de24d1b6869980", - "zh:be86fb122309f12fb956f2de42787e26aee74307b0c28ac51f5ddd3503896b81", - "zh:ef000b2e602a4d23c6657e3b52a8a1b720a46472b198ca2e5309fd257f753506", - "zh:f63f8d97c12b160c8dd7187d40849bcc5d96c80938c57db480552830de1e14a5", - "zh:fccaf02ed91528ecdde1515ce32e57f09f140d8b487b2c47dc2b1f0f8e76db8b", + "h1:FINkX7/X/cr5NEssB7dMqVWa6YtJtmwzvkfryuR39/k=", + "zh:0111f54de2a9815ded291f23136d41f3d2731c58ea663a2e8f0fef02d377d697", + "zh:0740152d76f0ccf54f4d0e8e0753739a5233b022acd60b5d2353d248c4c17204", + "zh:569518f46809ec9cdc082b4dfd4e828236eee2b50f87b301d624cfd83b8f5b0d", + "zh:7669f7691de91eec9f381e9a4be81aa4560f050348a86c6ea7804925752a01bb", + "zh:81cd53e796ec806aca2d8e92a2aed9135661e170eeff6cf0418e54f98816cd05", + "zh:82f01abd905090f978b169ac85d7a5952322a5f0f460269dd981b3596652d304", + "zh:9a235610066e0f7e567e69c23a53327271a6fc568b06bf152d8fe6594749ed2b", + "zh:aeabdd8e633d143feb67c52248c85358951321e35b43943aeab577c005abd30a", + "zh:c20d22dba5c79731918e7192bc3d0b364d47e98a74f47d287e6cc66236bc0ed0", + "zh:c4fea2cb18c31ed7723deec5ebaff85d6795bb6b6ed3b954794af064d17a7f9f", + "zh:e21e88b6e7e55b9f29b046730d9928c65a4f181fd5f60a42f1cd41b46a0a938d", + "zh:eddb888a74dea348a0acdfee13a08875bacddde384bd9c28342a534269665568", + "zh:f46d5f1403b8d8dfafab9bdd7129d3080bb62a91ea726f477fd43560887b8c4a", ] } diff --git a/demo-terraform-eks-cluster/aws.tf b/demo-terraform-eks-cluster/aws.tf new file mode 100644 index 0000000..054e197 --- /dev/null +++ b/demo-terraform-eks-cluster/aws.tf @@ -0,0 +1,17 @@ +variable aws_profile { + type = string + description = "The name of the profile to configure for the AWS CLI to provision infrastructure" + default = "default" +} + +variable aws_region { + type = string + description = "The name of the designated region to deploy the infrastructure" + default = "us-east-1" +} + + +provider "aws" { + profile = var.aws_profile + region = var.aws_region +} diff --git a/demo-terraform-eks-cluster/outputs.tf b/demo-terraform-eks-cluster/outputs.tf index 8823d2a..8e36898 100644 --- a/demo-terraform-eks-cluster/outputs.tf +++ b/demo-terraform-eks-cluster/outputs.tf @@ -25,7 +25,12 @@ output "config_map_aws_auth" { output "region" { description = "AWS region" - value = var.region + value = var.aws_region +} + +output "profile" { + description = "AWS CLI profile" + value = var.aws_profile } output "cluster_name" { diff --git a/demo-terraform-eks-cluster/vpc.tf b/demo-terraform-eks-cluster/vpc.tf index 37e07a3..14f4c79 100644 --- a/demo-terraform-eks-cluster/vpc.tf +++ b/demo-terraform-eks-cluster/vpc.tf @@ -1,11 +1,3 @@ -variable "region" { - default = "us-east-1" - description = "AWS region" -} - -provider "aws" { - region = "us-east-1" -} data "aws_availability_zones" "available" {}