From 4f0680231bf0875ad906d870c58e6487f032d58c Mon Sep 17 00:00:00 2001 From: velotioaastha Date: Wed, 4 Sep 2024 14:55:45 +0530 Subject: [PATCH] fix terraform lint and terraform fmt issues --- main.tf | 2 +- modules/app_aks/main.tf | 6 +++--- modules/app_lb/main.tf | 2 +- modules/app_lb/variables.tf | 2 +- modules/clickhouse/main.tf | 8 ++++---- modules/clickhouse/variables.tf | 4 ++-- modules/networking/main.tf | 8 ++++---- modules/networking/variables.tf | 2 +- variables.tf | 17 +++++++++-------- 9 files changed, 26 insertions(+), 25 deletions(-) diff --git a/main.tf b/main.tf index 7f0f8ff..10ceedc 100644 --- a/main.tf +++ b/main.tf @@ -260,7 +260,7 @@ module "wandb" { host = local.url license = var.license cloudProvider = "azure" - bucket = local.bucket_config == null ? { + bucket = local.bucket_config == null ? { provider = "az" name = module.storage[0].account.name path = "${module.storage[0].container.name}/${var.bucket_path}" diff --git a/modules/app_aks/main.tf b/modules/app_aks/main.tf index 0364275..0347e33 100644 --- a/modules/app_aks/main.tf +++ b/modules/app_aks/main.tf @@ -57,21 +57,21 @@ locals { } resource "azurerm_role_assignment" "gateway" { - depends_on = [ local.ingress_gateway_principal_id ] + depends_on = [local.ingress_gateway_principal_id] scope = var.gateway.id role_definition_name = "Contributor" principal_id = local.ingress_gateway_principal_id } resource "azurerm_role_assignment" "resource_group" { - depends_on = [ local.ingress_gateway_principal_id ] + depends_on = [local.ingress_gateway_principal_id] scope = var.resource_group.id role_definition_name = "Reader" principal_id = local.ingress_gateway_principal_id } resource "azurerm_role_assignment" "public_subnet" { - depends_on = [ local.ingress_gateway_principal_id ] + depends_on = [local.ingress_gateway_principal_id] scope = var.public_subnet.id role_definition_name = "Contributor" principal_id = local.ingress_gateway_principal_id diff --git a/modules/app_lb/main.tf b/modules/app_lb/main.tf index b046b30..518f200 100644 --- a/modules/app_lb/main.tf +++ b/modules/app_lb/main.tf @@ -17,7 +17,7 @@ locals { listener_name = "${var.network.name}-httplstn" request_routing_rule_name = "${var.network.name}-rqrt" redirect_configuration_name = "${var.network.name}-rdrcfg" - app_gateway_name = var.private_link ? "${var.namespace}-ag-private-link" : "${var.namespace}-ag" + app_gateway_name = var.private_link ? "${var.namespace}-ag-private-link" : "${var.namespace}-ag" } diff --git a/modules/app_lb/variables.tf b/modules/app_lb/variables.tf index 01c19f6..4c25a71 100644 --- a/modules/app_lb/variables.tf +++ b/modules/app_lb/variables.tf @@ -39,6 +39,6 @@ variable "private_subnet" { } variable "private_link" { - type = bool + type = bool description = "Specifies the Azure private link creation" } \ No newline at end of file diff --git a/modules/clickhouse/main.tf b/modules/clickhouse/main.tf index 01e5c9f..1d4e513 100644 --- a/modules/clickhouse/main.tf +++ b/modules/clickhouse/main.tf @@ -3,10 +3,10 @@ locals { } resource "azurerm_private_endpoint" "clickhouse" { - name = "${var.namespace}-clickhouse-pe" - location = var.location - resource_group_name = var.resource_group_name - subnet_id = var.private_subnet_id + name = "${var.namespace}-clickhouse-pe" + location = var.location + resource_group_name = var.resource_group_name + subnet_id = var.private_subnet_id custom_network_interface_name = "${var.namespace}-clickhouse-nic" private_service_connection { diff --git a/modules/clickhouse/variables.tf b/modules/clickhouse/variables.tf index 4819ed0..0dc6b7a 100644 --- a/modules/clickhouse/variables.tf +++ b/modules/clickhouse/variables.tf @@ -29,7 +29,7 @@ variable "clickhouse_private_endpoint_service_name" { default = "" validation { - condition = can(regex("\\.azure\\.privatelinkservice$", var.clickhouse_private_endpoint_service_name)) + condition = can(regex("\\.azure\\.privatelinkservice$", var.clickhouse_private_endpoint_service_name)) error_message = "ClickHouse Service name must end in '.azure.privatelinkservice'." } } @@ -40,7 +40,7 @@ variable "clickhouse_region" { default = "" validation { - condition = length(var.clickhouse_region) > 0 + condition = length(var.clickhouse_region) > 0 error_message = "Clickhouse Region should always be set if the private endpoint service name is specified." } } diff --git a/modules/networking/main.tf b/modules/networking/main.tf index a5f2bc5..1528407 100644 --- a/modules/networking/main.tf +++ b/modules/networking/main.tf @@ -9,10 +9,10 @@ resource "azurerm_virtual_network" "default" { } resource "azurerm_subnet" "private" { - name = "${var.namespace}-private" - resource_group_name = var.resource_group_name - address_prefixes = [var.network_private_subnet_cidr] - virtual_network_name = azurerm_virtual_network.default.name + name = "${var.namespace}-private" + resource_group_name = var.resource_group_name + address_prefixes = [var.network_private_subnet_cidr] + virtual_network_name = azurerm_virtual_network.default.name private_link_service_network_policies_enabled = var.private_link ? false : true service_endpoints = concat( diff --git a/modules/networking/variables.tf b/modules/networking/variables.tf index af10679..81735e7 100644 --- a/modules/networking/variables.tf +++ b/modules/networking/variables.tf @@ -56,7 +56,7 @@ variable "tags" { } variable "private_link" { - type = bool + type = bool description = "Private link flag for multi region storage endpoint access" } diff --git a/variables.tf b/variables.tf index e5e5060..e5c2fd0 100644 --- a/variables.tf +++ b/variables.tf @@ -34,13 +34,13 @@ variable "size" { nullable = true type = string } - +# tflint-ignore: terraform_unused_declarations variable "wandb_version" { description = "The version of Weights & Biases local to deploy." type = string default = "latest" } - +# tflint-ignore: terraform_unused_declarations variable "wandb_image" { description = "Docker repository of to pull the wandb image from." type = string @@ -51,26 +51,26 @@ variable "license" { type = string description = "Your wandb/local license" } - +# tflint-ignore: terraform_unused_declarations variable "oidc_issuer" { type = string description = "A url to your Open ID Connect identity provider, i.e. https://cognito-idp.us-east-1.amazonaws.com/us-east-1_uiIFNdacd" default = "" } - +# tflint-ignore: terraform_unused_declarations variable "oidc_client_id" { type = string description = "The Client ID of application in your identity provider" default = "" } - +# tflint-ignore: terraform_unused_declarations variable "oidc_secret" { type = string description = "The Client secret of application in your identity provider" default = "" sensitive = true } - +# tflint-ignore: terraform_unused_declarations variable "oidc_auth_method" { type = string description = "OIDC auth method" @@ -138,6 +138,7 @@ variable "database_sku_name" { ########################################## # Redis # ########################################## +# tflint-ignore: terraform_unused_declarations variable "create_redis" { type = bool description = "Boolean indicating whether to provision an redis instance (true) or not (false)." @@ -247,13 +248,13 @@ variable "allowed_ip_ranges" { type = list(string) default = [] } - +# tflint-ignore: terraform_unused_declarations variable "weave_wandb_env" { type = map(string) description = "Extra environment variables for W&B" default = {} } - +# tflint-ignore: terraform_unused_declarations variable "app_wandb_env" { type = map(string) description = "Extra environment variables for W&B"