Skip to content

Commit

Permalink
fix terraform lint and terraform fmt issues
Browse files Browse the repository at this point in the history
  • Loading branch information
velotioaastha committed Sep 4, 2024
1 parent def41c7 commit 4f06802
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 25 deletions.
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
6 changes: 3 additions & 3 deletions modules/app_aks/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion modules/app_lb/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}


Expand Down
2 changes: 1 addition & 1 deletion modules/app_lb/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ variable "private_subnet" {
}

variable "private_link" {
type = bool
type = bool
description = "Specifies the Azure private link creation"
}
8 changes: 4 additions & 4 deletions modules/clickhouse/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions modules/clickhouse/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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'."
}
}
Expand All @@ -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."
}
}
8 changes: 4 additions & 4 deletions modules/networking/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion modules/networking/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ variable "tags" {
}

variable "private_link" {
type = bool
type = bool
description = "Private link flag for multi region storage endpoint access"
}

Expand Down
17 changes: 9 additions & 8 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down Expand Up @@ -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)."
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 4f06802

Please sign in to comment.