Skip to content

Commit

Permalink
chore: fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
danielpanzella committed Aug 29, 2024
1 parent 9d79564 commit 9ed24d8
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 57 deletions.
50 changes: 25 additions & 25 deletions deployment-size.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
38 changes: 19 additions & 19 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions modules/app_aks/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
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/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
2 changes: 1 addition & 1 deletion outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down

0 comments on commit 9ed24d8

Please sign in to comment.