From 51979704502b663474c74ab3761160f758d22e7c Mon Sep 17 00:00:00 2001 From: SonOfLope Date: Wed, 7 Feb 2024 15:10:15 -0500 Subject: [PATCH] Issue #30: Fix terraform lint violations --- .../modules/gcp-kubernetes-cluster/cluster.tf | 2 +- .../gcp-kubernetes-cluster/provider.tf | 3 ++ terraform/prod/main.tf | 38 +++++++++---------- terraform/staging/main.tf | 2 + terraform/staging/variables.tf | 8 ++-- 5 files changed, 29 insertions(+), 24 deletions(-) diff --git a/terraform/modules/gcp-kubernetes-cluster/cluster.tf b/terraform/modules/gcp-kubernetes-cluster/cluster.tf index fb74b3f2..117e7b12 100644 --- a/terraform/modules/gcp-kubernetes-cluster/cluster.tf +++ b/terraform/modules/gcp-kubernetes-cluster/cluster.tf @@ -12,7 +12,7 @@ resource "google_container_cluster" "cluster" { # Optional, if you want multi-zonal cluster node_locations = [ - "${var.location_2}" + var.location_2 ] addons_config { diff --git a/terraform/modules/gcp-kubernetes-cluster/provider.tf b/terraform/modules/gcp-kubernetes-cluster/provider.tf index e34c6fc7..2430cac2 100644 --- a/terraform/modules/gcp-kubernetes-cluster/provider.tf +++ b/terraform/modules/gcp-kubernetes-cluster/provider.tf @@ -1,4 +1,7 @@ terraform { + + required_version = ">= 1.7.2" + required_providers { local = { source = "hashicorp/local" diff --git a/terraform/prod/main.tf b/terraform/prod/main.tf index 22f15b3e..ef0e483b 100644 --- a/terraform/prod/main.tf +++ b/terraform/prod/main.tf @@ -1,25 +1,25 @@ -# terraform { +terraform { -# required_version = ">= 1.1.0" + required_version = ">= 1.1.0" -# backend "azurerm" { -# resource_group_name = "rg-ai-cfia-terraform-state" -# storage_account_name = "tfcfiastate" -# container_name = "infra-terraform-state" -# key = "tf/terraform.tfstate" -# } + # backend "azurerm" { + # resource_group_name = "rg-ai-cfia-terraform-state" + # storage_account_name = "tfcfiastate" + # container_name = "infra-terraform-state" + # key = "tf/terraform.tfstate" + # } -# required_providers { -# azurerm = { -# source = "hashicorp/azurerm" -# version = "~> 3.25" -# } -# kubernetes = { -# source = "hashicorp/kubernetes" -# version = "2.24.0" -# } -# } -# } + # required_providers { + # azurerm = { + # source = "hashicorp/azurerm" + # version = "~> 3.25" + # } + # kubernetes = { + # source = "hashicorp/kubernetes" + # version = "2.24.0" + # } + # } +} # provider "azurerm" { # features {} diff --git a/terraform/staging/main.tf b/terraform/staging/main.tf index 96c5e5cd..acfd31c7 100644 --- a/terraform/staging/main.tf +++ b/terraform/staging/main.tf @@ -1,5 +1,7 @@ terraform { + required_version = ">= 1.7.2" + backend "azurerm" { resource_group_name = "rg-ai-cfia-terraform-state" storage_account_name = "tfcfiastate" diff --git a/terraform/staging/variables.tf b/terraform/staging/variables.tf index 84c7e399..b069b2f4 100644 --- a/terraform/staging/variables.tf +++ b/terraform/staging/variables.tf @@ -1,4 +1,4 @@ -variable "kube_ctx" { - description = "The kubernetes cluster context." - type = string -} +# variable "kube_ctx" { +# description = "The kubernetes cluster context." +# type = string +# }