From 9ed24d8109417f60f9559ab837c19b532d93df70 Mon Sep 17 00:00:00 2001 From: Daniel Panzella Date: Thu, 29 Aug 2024 07:40:01 -0700 Subject: [PATCH] chore: fix formatting --- deployment-size.tf | 50 ++++++++++++++++----------------- main.tf | 38 ++++++++++++------------- modules/app_aks/main.tf | 10 +++---- modules/app_lb/main.tf | 2 +- modules/app_lb/variables.tf | 2 +- modules/networking/main.tf | 8 +++--- modules/networking/variables.tf | 2 +- outputs.tf | 2 +- 8 files changed, 57 insertions(+), 57 deletions(-) diff --git a/deployment-size.tf b/deployment-size.tf index 702325f..c3a1055 100644 --- a/deployment-size.tf +++ b/deployment-size.tf @@ -2,39 +2,39 @@ locals { # Specifications for t-shirt sized deployments deployment_size = { small = { - db = "MO_Standard_E2ds_v4", - min_node_count = 2, - max_node_count = 3, - node_instance = "Standard_E4s_v5" - cache = "3" + db = "MO_Standard_E2ds_v4", + min_node_count = 2, + max_node_count = 3, + node_instance = "Standard_E4s_v5" + cache = "3" }, medium = { - db = "MO_Standard_E4ds_v4", - min_node_count = 2, - max_node_count = 4, - node_instance = "Standard_E4s_v5" - cache = "3" + db = "MO_Standard_E4ds_v4", + min_node_count = 2, + max_node_count = 4, + node_instance = "Standard_E4s_v5" + cache = "3" }, large = { - db = "MO_Standard_E8ds_v4", - min_node_count = 2, - max_node_count = 3, - node_instance = "Standard_E8s_v5" - cache = "4" + db = "MO_Standard_E8ds_v4", + min_node_count = 2, + max_node_count = 3, + node_instance = "Standard_E8s_v5" + cache = "4" }, xlarge = { - db = "MO_Standard_E16ds_v4", - min_node_count = 3, - max_node_count = 4, - node_instance = "Standard_E8s_v5" - cache = "4" + db = "MO_Standard_E16ds_v4", + min_node_count = 3, + max_node_count = 4, + node_instance = "Standard_E8s_v5" + cache = "4" }, xxlarge = { - db = "MO_Standard_E32ds_v4", - min_node_count = 3, - max_node_count = 5, - node_instance = "Standard_E16s_v5" - cache = "5" + db = "MO_Standard_E32ds_v4", + min_node_count = 3, + max_node_count = 5, + node_instance = "Standard_E16s_v5" + cache = "5" } } } \ No newline at end of file diff --git a/main.tf b/main.tf index e0f3a5b..959747d 100644 --- a/main.tf +++ b/main.tf @@ -3,9 +3,9 @@ locals { url_prefix = var.ssl ? "https" : "http" url = "${local.url_prefix}://${local.fqdn}" - redis_capacity = coalesce(var.redis_capacity, local.deployment_size[var.size].cache) - database_sku_name = coalesce(var.database_sku_name, local.deployment_size[var.size].db) - kubernetes_instance_type = coalesce(var.kubernetes_instance_type, local.deployment_size[var.size].node_instance) + redis_capacity = coalesce(var.redis_capacity, local.deployment_size[var.size].cache) + database_sku_name = coalesce(var.database_sku_name, local.deployment_size[var.size].db) + kubernetes_instance_type = coalesce(var.kubernetes_instance_type, local.deployment_size[var.size].node_instance) kubernetes_min_node_count = coalesce(var.kubernetes_min_node_count, local.deployment_size[var.size].min_node_count) kubernetes_max_node_count = coalesce(var.kubernetes_max_node_count, local.deployment_size[var.size].max_node_count) } @@ -117,21 +117,21 @@ module "app_aks" { source = "./modules/app_aks" depends_on = [module.app_lb] - cluster_subnet_id = module.networking.private_subnet.id - etcd_key_vault_key_id = module.vault.etcd_key_id - gateway = module.app_lb.gateway - identity = module.identity.identity - location = azurerm_resource_group.default.location - namespace = var.namespace - node_pool_min_vm_count = local.kubernetes_min_node_count - node_pool_max_vm_count = local.kubernetes_max_node_count - node_pool_vm_size = local.kubernetes_instance_type - node_pool_zones = var.node_pool_zones - public_subnet = module.networking.public_subnet - resource_group = azurerm_resource_group.default - sku_tier = var.cluster_sku_tier - max_pods = var.node_max_pods - tags = var.tags + cluster_subnet_id = module.networking.private_subnet.id + etcd_key_vault_key_id = module.vault.etcd_key_id + gateway = module.app_lb.gateway + identity = module.identity.identity + location = azurerm_resource_group.default.location + namespace = var.namespace + node_pool_min_vm_count = local.kubernetes_min_node_count + node_pool_max_vm_count = local.kubernetes_max_node_count + node_pool_vm_size = local.kubernetes_instance_type + node_pool_zones = var.node_pool_zones + public_subnet = module.networking.public_subnet + resource_group = azurerm_resource_group.default + sku_tier = var.cluster_sku_tier + max_pods = var.node_max_pods + tags = var.tags } locals { service_account_name = "wandb-app" @@ -254,7 +254,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 diff --git a/modules/app_aks/main.tf b/modules/app_aks/main.tf index 360e208..1858b56 100644 --- a/modules/app_aks/main.tf +++ b/modules/app_aks/main.tf @@ -22,8 +22,8 @@ resource "azurerm_kubernetes_cluster" "default" { max_pods = var.max_pods name = "default" node_count = var.node_pool_min_vm_count - max_count = var.node_pool_max_vm_count - min_count = var.node_pool_min_vm_count + max_count = var.node_pool_max_vm_count + min_count = var.node_pool_min_vm_count temporary_name_for_rotation = "rotating" type = "VirtualMachineScaleSets" vm_size = var.node_pool_vm_size @@ -59,21 +59,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/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/outputs.tf b/outputs.tf index b208612..08bde10 100644 --- a/outputs.tf +++ b/outputs.tf @@ -58,7 +58,7 @@ output "aks_node_instance_type" { } output "database_instance_type" { - value =local.database_sku_name + value = local.database_sku_name } output "client_id" {