From 2c85f4b76066626be655dae1c11178933c8de9b0 Mon Sep 17 00:00:00 2001 From: Giulio Giunta <56529931+giulio-giunta@users.noreply.github.com> Date: Mon, 6 May 2024 16:37:42 +0100 Subject: [PATCH] Updated Terraform version in cicd executor, pinned aks module version and added terraform lock in gitignore * Updated Terraform version in cicd executor, pinned aks module version, added terraform lock file in gitignore * Updated deprecated keys in circleci config file * Removed entry from gitignore * Reinstated entry in gitignore * Removed Terraform lock file --- .circleci/config.yml | 10 +-- .gitignore | 3 + azure/terraform-azure/.terraform.lock.hcl | 82 ----------------------- azure/terraform-azure/main.tf | 3 +- 4 files changed, 10 insertions(+), 88 deletions(-) delete mode 100644 azure/terraform-azure/.terraform.lock.hcl diff --git a/.circleci/config.yml b/.circleci/config.yml index 151f5b2..81a8161 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,7 +6,7 @@ jobs: steps: - checkout - setup_remote_docker: - version: 20.10.7 + version: default - run: name: Create .terraformrc file locally command: >- @@ -15,8 +15,8 @@ jobs: - run: name: Install Terraform cli command: | - wget https://releases.hashicorp.com/terraform/1.4.2/terraform_1.4.2_linux_386.zip - unzip terraform_1.4.2_linux_386.zip + wget https://releases.hashicorp.com/terraform/1.8.2/terraform_1.8.2_linux_386.zip + unzip terraform_1.8.2_linux_386.zip sudo mv terraform /usr/local/bin - run: name: Terraform cycle @@ -37,12 +37,12 @@ jobs: steps: - checkout - setup_remote_docker: - version: 20.10.7 + version: default - run: name: Build geekzone/infra image command: | docker build -t geekzone/infra:$TAG . - - deploy: + - run: name: Push geekzone/infra image to Docker Hub command: | docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD diff --git a/.gitignore b/.gitignore index 77fce16..b2d7d0d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,9 @@ # Local .terraform directories **/.terraform/* +# Providers version file +**/.terraform.lock.hcl + # .tfstate files terraform/*.tfstate terraform/*.tfstate.* diff --git a/azure/terraform-azure/.terraform.lock.hcl b/azure/terraform-azure/.terraform.lock.hcl deleted file mode 100644 index 22da1da..0000000 --- a/azure/terraform-azure/.terraform.lock.hcl +++ /dev/null @@ -1,82 +0,0 @@ -# This file is maintained automatically by "terraform init". -# Manual edits may be lost in future updates. - -provider "registry.terraform.io/azure/azapi" { - version = "1.9.0" - constraints = ">= 1.4.0, < 2.0.0" - hashes = [ - "h1:zaLH2Owmj61RX2G1Cy6VDy8Ttfzx+lDsSCyiu5cXkm4=", - "zh:349569471fbf387feaaf8b88da1690669e201147c342f905e5eb03df42b3cf87", - "zh:54346d5fb78cbad3eb7cfd96e1dd7ce4f78666cabaaccfec6ee9437476330018", - "zh:64b799da915ea3a9a58ac7a926c6a31c59fd0d911687804d8e815eda88c5580b", - "zh:9336ed9e112555e0fda8af6be9ba21478e30117d79ba662233311d9560d2b7c6", - "zh:a8aace9897b28ea0b2dbd7a3be3df033e158af40412c9c7670be0956f216ed7e", - "zh:ab23df7de700d9e785009a4ca9ceb38ae1ab894a13f5788847f15d018556f415", - "zh:b4f13f0b13560a67d427c71c85246f8920f98987120341830071df4535842053", - "zh:e58377bf36d8a14d28178a002657865ee17446182dac03525fd43435e41a1b5c", - "zh:ea5db4acc6413fd0fe6b35981e58cdc9850f5f3118031cc3d2581de511aee6aa", - "zh:f0b32c06c6bd4e4af2c02a62be07b947766aeeb09289a03f21aba16c2fd3c60f", - "zh:f1518e766a90c257d7eb36d360dafaf311593a4a9352ff8db0bcfe0ed8cf45ae", - "zh:fa89e84cff0776b5b61ff27049b1d8ed52040bd58c81c4628890d644a6fb2989", - ] -} - -provider "registry.terraform.io/hashicorp/azurerm" { - version = "3.74.0" - constraints = ">= 3.69.0, < 4.0.0" - hashes = [ - "h1:ETVZfmulZQ435+lgFCkZRpfVOLyAxfDOwbPXFg3aLLQ=", - "zh:0424c70152f949da1ec52ba96d20e5fd32fd22d9bd9203ce045d5f6aab3d20fc", - "zh:16dbf581d10f8e7937185bcdcceb4f91d08c919e452fb8da7580071288c8c397", - "zh:3019103bc2c3b4e185f5c65696c349697644c968f5c085af5505fed6d01c4241", - "zh:49bb56ebaed6653fdb913c2b2bb74fc8b5399e7258d1e89084f72c44ea1130dd", - "zh:85547666517f899d88620bd23a000a8f43c7dc93587c350eb1ea17bcb3e645c7", - "zh:8bed8b646ff1822d8764de68b56b71e5dd971a4b77eba80d47f400a530800bea", - "zh:8bfa6c70c004ba05ebce47f74f49ce872c28a68a18bb71b281a9681bcbbdbfa1", - "zh:a2ae9e38fda0695fb8aa810e4f1ce4b104bfda651a87923b307bb1728680d8b6", - "zh:beac1efe32f99072c892095f5ff46e40d6852b66679a03bc3acbe1b90fb1f653", - "zh:d8a6ca20e49ebe7ea5688d91233d571e2c2ccc3e41000c39a7d7031df209ea8e", - "zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c", - "zh:f937b5fdf49b072c0347408d0a1c5a5d822dae1a23252915930e5a82d1d8ce8b", - ] -} - -provider "registry.terraform.io/hashicorp/null" { - version = "3.2.1" - constraints = ">= 3.0.0" - hashes = [ - "h1:FbGfc+muBsC17Ohy5g806iuI1hQc4SIexpYCrQHQd8w=", - "zh:58ed64389620cc7b82f01332e27723856422820cfd302e304b5f6c3436fb9840", - "zh:62a5cc82c3b2ddef7ef3a6f2fedb7b9b3deff4ab7b414938b08e51d6e8be87cb", - "zh:63cff4de03af983175a7e37e52d4bd89d990be256b16b5c7f919aff5ad485aa5", - "zh:74cb22c6700e48486b7cabefa10b33b801dfcab56f1a6ac9b6624531f3d36ea3", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:79e553aff77f1cfa9012a2218b8238dd672ea5e1b2924775ac9ac24d2a75c238", - "zh:a1e06ddda0b5ac48f7e7c7d59e1ab5a4073bbcf876c73c0299e4610ed53859dc", - "zh:c37a97090f1a82222925d45d84483b2aa702ef7ab66532af6cbcfb567818b970", - "zh:e4453fbebf90c53ca3323a92e7ca0f9961427d2f0ce0d2b65523cc04d5d999c2", - "zh:e80a746921946d8b6761e77305b752ad188da60688cfd2059322875d363be5f5", - "zh:fbdb892d9822ed0e4cb60f2fedbdbb556e4da0d88d3b942ae963ed6ff091e48f", - "zh:fca01a623d90d0cad0843102f9b8b9fe0d3ff8244593bd817f126582b52dd694", - ] -} - -provider "registry.terraform.io/hashicorp/tls" { - version = "4.0.4" - constraints = ">= 3.1.0" - hashes = [ - "h1:pe9vq86dZZKCm+8k1RhzARwENslF3SXb9ErHbQfgjXU=", - "zh:23671ed83e1fcf79745534841e10291bbf34046b27d6e68a5d0aab77206f4a55", - "zh:45292421211ffd9e8e3eb3655677700e3c5047f71d8f7650d2ce30242335f848", - "zh:59fedb519f4433c0fdb1d58b27c210b27415fddd0cd73c5312530b4309c088be", - "zh:5a8eec2409a9ff7cd0758a9d818c74bcba92a240e6c5e54b99df68fff312bbd5", - "zh:5e6a4b39f3171f53292ab88058a59e64825f2b842760a4869e64dc1dc093d1fe", - "zh:810547d0bf9311d21c81cc306126d3547e7bd3f194fc295836acf164b9f8424e", - "zh:824a5f3617624243bed0259d7dd37d76017097dc3193dac669be342b90b2ab48", - "zh:9361ccc7048be5dcbc2fafe2d8216939765b3160bd52734f7a9fd917a39ecbd8", - "zh:aa02ea625aaf672e649296bce7580f62d724268189fe9ad7c1b36bb0fa12fa60", - "zh:c71b4cd40d6ec7815dfeefd57d88bc592c0c42f5e5858dcc88245d371b4b8b1e", - "zh:dabcd52f36b43d250a3d71ad7abfa07b5622c69068d989e60b79b2bb4f220316", - "zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c", - ] -} diff --git a/azure/terraform-azure/main.tf b/azure/terraform-azure/main.tf index 8e80b1d..1b1d285 100644 --- a/azure/terraform-azure/main.tf +++ b/azure/terraform-azure/main.tf @@ -106,6 +106,7 @@ resource "azurerm_subnet" "endpoint" { module "aks" { source = "Azure/aks/azurerm" + version = "7.4.0" resource_group_name = azurerm_resource_group.geekzone.name client_id = var.ARM_CLIENT_ID client_secret = var.ARM_CLIENT_SECRET @@ -120,7 +121,7 @@ module "aks" { role_based_access_control_enabled = false rbac_aad = false rbac_aad_managed = false - private_cluster_enabled = false # default value + private_cluster_enabled = false http_application_routing_enabled = false azure_policy_enabled = true public_network_access_enabled = false