From f9cfa7c44ed380b1979cf25fa8d3c2bbdde6bead Mon Sep 17 00:00:00 2001 From: Daniel Panzella Date: Thu, 29 Aug 2024 07:41:05 -0700 Subject: [PATCH] chore: fix formatting --- deployment-size.tf | 24 +++++----- .../custom-tf-with-existing-resources/data.tf | 4 +- .../custom-tf-with-existing-resources/main.tf | 4 +- .../variables.tf | 46 +++++++++---------- examples/custom-tf-with-vpc-sql/data.tf | 2 +- examples/custom-tf-with-vpc-sql/main.tf | 4 +- examples/custom-tf-with-vpc-sql/variables.tf | 30 ++++++------ examples/standard-tf/main.tf | 12 ++--- examples/standard-tf/variables.tf | 14 +++--- modules/app_gke/main.tf | 6 +-- modules/kms/main.tf | 2 +- modules/kms/outputs.tf | 2 +- modules/kms/variables.tf | 4 +- modules/private_link/outputs.tf | 2 +- modules/private_link/variables.tf | 6 +-- modules/redis/main.tf | 8 ++-- modules/service_accounts/outputs.tf | 2 +- modules/storage/bucket/main.tf | 4 +- outputs.tf | 6 +-- variables.tf | 14 +++--- versions.tf | 2 +- 21 files changed, 99 insertions(+), 99 deletions(-) diff --git a/deployment-size.tf b/deployment-size.tf index a9c36c7b..5d5fec9d 100644 --- a/deployment-size.tf +++ b/deployment-size.tf @@ -9,32 +9,32 @@ locals { cache = "6" }, medium = { - db = "db-n1-highmem-4", + db = "db-n1-highmem-4", min_node_count = 2, max_node_count = 4, - node_instance = "n2-highmem-4" - cache = "6" + node_instance = "n2-highmem-4" + cache = "6" }, large = { - db = "db-n1-highmem-8", + db = "db-n1-highmem-8", min_node_count = 3, max_node_count = 4, - node_instance = "n2-highmem-8" - cache = "13" + node_instance = "n2-highmem-8" + cache = "13" }, xlarge = { - db = "db-n1-highmem-16", + db = "db-n1-highmem-16", min_node_count = 3, max_node_count = 5, - node_instance = "n2-highmem-8" - cache = "13" + node_instance = "n2-highmem-8" + cache = "13" }, xxlarge = { - db = "db-n1-highmem-32", + db = "db-n1-highmem-32", min_node_count = 3, max_node_count = 6, - node_instance = "n2-highmem-16" - cache = "26" + node_instance = "n2-highmem-16" + cache = "26" } } } diff --git a/examples/custom-tf-with-existing-resources/data.tf b/examples/custom-tf-with-existing-resources/data.tf index 0d075209..c5aa6ce2 100644 --- a/examples/custom-tf-with-existing-resources/data.tf +++ b/examples/custom-tf-with-existing-resources/data.tf @@ -6,11 +6,11 @@ data "google_compute_network" "default" { data "google_compute_subnetwork" "default" { - name = var.subnetwork + name = var.subnetwork } data "google_container_cluster" "default" { - name = var.cluster_name + name = var.cluster_name } data "google_redis_instance" "default" { diff --git a/examples/custom-tf-with-existing-resources/main.tf b/examples/custom-tf-with-existing-resources/main.tf index 60ea7f62..69752732 100644 --- a/examples/custom-tf-with-existing-resources/main.tf +++ b/examples/custom-tf-with-existing-resources/main.tf @@ -52,8 +52,8 @@ locals { url = "${local.url_prefix}://${local.fqdn}" internal_app_port = 32543 create_bucket = var.bucket_name == "" - network = data.google_compute_network.default - subnetwork = data.google_compute_subnetwork.default + network = data.google_compute_network.default + subnetwork = data.google_compute_subnetwork.default } module "service_accounts" { diff --git a/examples/custom-tf-with-existing-resources/variables.tf b/examples/custom-tf-with-existing-resources/variables.tf index 5235afed..e4202fbc 100644 --- a/examples/custom-tf-with-existing-resources/variables.tf +++ b/examples/custom-tf-with-existing-resources/variables.tf @@ -8,31 +8,31 @@ variable "allowed_inbound_cidrs" { variable "project_id" { type = string description = "Project ID" - default = "" + default = "" } variable "region" { type = string description = "Google region" - default = "us-central1" + default = "us-central1" } variable "zone" { type = string description = "Google zone" - default = "us-central1-b" + default = "us-central1-b" } variable "namespace" { type = string description = "Namespace prefix used for resources" - default = "" + default = "" } variable "domain_name" { type = string description = "Domain name for accessing the Weights & Biases UI." - default = "" + default = "" } variable "subdomain" { @@ -48,9 +48,9 @@ variable "gke_machine_type" { } variable "license" { - type = string + type = string default = "" - } +} variable "wandb_version" { description = "The version of Weights & Biases local to deploy." @@ -65,7 +65,7 @@ variable "wandb_image" { } variable "database_env" { - nullable = false + nullable = false type = object({ name = string database_name = string @@ -76,12 +76,12 @@ variable "database_env" { }) default = { - name = "**" - username = "**" - password = "**" - database_name = "**" - private_ip_address = "**" - connection_string = "**" # "mysql://${username}:${password}@${private_ip_address}/${database_name}" + name = "**" + username = "**" + password = "**" + database_name = "**" + private_ip_address = "**" + connection_string = "**" # "mysql://${username}:${password}@${private_ip_address}/${database_name}" } } @@ -159,36 +159,36 @@ variable "deletion_protection" { } variable "network" { - nullable = false + nullable = false default = "" description = "Pre-existing network self link" type = string } variable "subnetwork" { - nullable = false + nullable = false default = "" description = "Pre-existing subnetwork self link" type = string } variable "cluster_name" { - type = string + type = string nullable = false - default = "" + default = "" } variable "redis_cluster_name" { - type = string + type = string default = "" } variable "redis_env" { - nullable = false + nullable = false type = object({ - password = string - host = string - port = string + password = string + host = string + port = string connection_string = string }) diff --git a/examples/custom-tf-with-vpc-sql/data.tf b/examples/custom-tf-with-vpc-sql/data.tf index ebf14336..9af1e184 100644 --- a/examples/custom-tf-with-vpc-sql/data.tf +++ b/examples/custom-tf-with-vpc-sql/data.tf @@ -4,5 +4,5 @@ data "google_compute_network" "network" { data "google_compute_subnetwork" "subnetwork" { - name = var.subnetwork + name = var.subnetwork } \ No newline at end of file diff --git a/examples/custom-tf-with-vpc-sql/main.tf b/examples/custom-tf-with-vpc-sql/main.tf index 736b2a84..3d074114 100644 --- a/examples/custom-tf-with-vpc-sql/main.tf +++ b/examples/custom-tf-with-vpc-sql/main.tf @@ -55,8 +55,8 @@ locals { url = "${local.url_prefix}://${local.fqdn}" internal_app_port = 32543 create_bucket = var.bucket_name == "" - network = data.google_compute_network.network - subnetwork = data.google_compute_subnetwork.subnetwork + network = data.google_compute_network.network + subnetwork = data.google_compute_subnetwork.subnetwork } diff --git a/examples/custom-tf-with-vpc-sql/variables.tf b/examples/custom-tf-with-vpc-sql/variables.tf index f2ee2ea6..b17b0cb6 100644 --- a/examples/custom-tf-with-vpc-sql/variables.tf +++ b/examples/custom-tf-with-vpc-sql/variables.tf @@ -14,31 +14,31 @@ variable "create_redis" { variable "project_id" { type = string description = "Project ID" - default = "" + default = "" } variable "region" { type = string description = "Google region" - default = "us-central1" + default = "us-central1" } variable "zone" { type = string description = "Google zone" - default = "us-central1-b" + default = "us-central1-b" } variable "namespace" { type = string description = "Namespace prefix used for resources" - default = "" + default = "" } variable "domain_name" { type = string description = "Domain name for accessing the Weights & Biases UI." - default = "" + default = "" } variable "subdomain" { @@ -54,7 +54,7 @@ variable "gke_machine_type" { } variable "license" { - type = string + type = string default = "" } @@ -71,7 +71,7 @@ variable "wandb_image" { } variable "database_env" { - nullable = false + nullable = false type = object({ name = string database_name = string @@ -82,12 +82,12 @@ variable "database_env" { }) default = { - name = "**" - username = "**" - password = "**" - database_name = "**" - private_ip_address = "**" - connection_string = "**" # "mysql://${username}:${password}@${private_ip_address}/${database_name}" + name = "**" + username = "**" + password = "**" + database_name = "**" + private_ip_address = "**" + connection_string = "**" # "mysql://${username}:${password}@${private_ip_address}/${database_name}" } } @@ -165,14 +165,14 @@ variable "deletion_protection" { } variable "network" { - nullable = false + nullable = false default = "" description = "Pre-existing network self link" type = string } variable "subnetwork" { - nullable = false + nullable = false default = "" description = "Pre-existing subnetwork self link" type = string diff --git a/examples/standard-tf/main.tf b/examples/standard-tf/main.tf index 67011a56..3d740ae9 100644 --- a/examples/standard-tf/main.tf +++ b/examples/standard-tf/main.tf @@ -37,11 +37,11 @@ module "wandb" { domain_name = var.domain_name subdomain = var.subdomain - gke_machine_type = var.gke_machine_type - resource_limits = var.resource_limits + gke_machine_type = var.gke_machine_type + resource_limits = var.resource_limits resource_requests = var.resource_requests - wandb_version = var.wandb_version - wandb_image = var.wandb_image + wandb_version = var.wandb_version + wandb_image = var.wandb_image create_redis = var.create_redis use_internal_queue = true @@ -51,11 +51,11 @@ module "wandb" { database_sort_buffer_size = var.database_sort_buffer_size database_machine_type = var.database_machine_type - database_version = var.database_version + database_version = var.database_version disable_code_saving = var.disable_code_saving size = var.size - labels = var.labels + labels = var.labels diff --git a/examples/standard-tf/variables.tf b/examples/standard-tf/variables.tf index c73a411d..9449c9fb 100644 --- a/examples/standard-tf/variables.tf +++ b/examples/standard-tf/variables.tf @@ -15,31 +15,31 @@ variable "create_redis" { variable "project_id" { type = string description = "Project ID" - default = "" + default = "" } variable "region" { type = string description = "Google region" - default = "us-central1" + default = "us-central1" } variable "zone" { type = string description = "Google zone" - default = "us-central1-b" + default = "us-central1-b" } variable "namespace" { type = string description = "Namespace prefix used for resources" - default = "" + default = "" } variable "domain_name" { type = string description = "Domain name for accessing the Weights & Biases UI." - default = "" + default = "" } variable "subdomain" { @@ -55,9 +55,9 @@ variable "gke_machine_type" { } variable "license" { - type = string + type = string default = "" - } +} variable "wandb_version" { description = "The version of Weights & Biases local to deploy." diff --git a/modules/app_gke/main.tf b/modules/app_gke/main.tf index 511573f7..14240640 100644 --- a/modules/app_gke/main.tf +++ b/modules/app_gke/main.tf @@ -57,13 +57,13 @@ resource "random_pet" "node_pool" { } resource "google_container_node_pool" "default" { - name = "default-pool-${random_pet.node_pool.id}" - cluster = google_container_cluster.default.id + name = "default-pool-${random_pet.node_pool.id}" + cluster = google_container_cluster.default.id autoscaling { total_max_node_count = var.max_node_count total_min_node_count = var.min_node_count - location_policy = "BALANCED" + location_policy = "BALANCED" } node_config { diff --git a/modules/kms/main.tf b/modules/kms/main.tf index 7fceb251..c38d40d4 100644 --- a/modules/kms/main.tf +++ b/modules/kms/main.tf @@ -5,7 +5,7 @@ resource "random_pet" "key_ring" { resource "google_kms_key_ring" "default" { name = "${var.namespace}-${random_pet.key_ring.id}" - location = var.key_location + location = var.key_location } diff --git a/modules/kms/outputs.tf b/modules/kms/outputs.tf index 90fe7325..3cea3ecf 100644 --- a/modules/kms/outputs.tf +++ b/modules/kms/outputs.tf @@ -2,5 +2,5 @@ output "crypto_key" { value = google_kms_crypto_key.default } output "google_kms_crypto_key_iam_binding" { - value = google_kms_crypto_key_iam_binding.crypto_key + value = google_kms_crypto_key_iam_binding.crypto_key } \ No newline at end of file diff --git a/modules/kms/variables.tf b/modules/kms/variables.tf index ac3328dc..3153786d 100644 --- a/modules/kms/variables.tf +++ b/modules/kms/variables.tf @@ -12,11 +12,11 @@ variable "deletion_protection" { variable "key_location" { type = string description = "Location where the KMS key will be created." - default = "global" + default = "global" } variable "bind_pubsub_service_to_kms_key" { type = bool description = "Whether to bind the Pub/Sub service account to the KMS key for encrypter/decrypter access." - default = true + default = true } \ No newline at end of file diff --git a/modules/private_link/outputs.tf b/modules/private_link/outputs.tf index d92b5bd3..7ced38ba 100644 --- a/modules/private_link/outputs.tf +++ b/modules/private_link/outputs.tf @@ -1,3 +1,3 @@ output "private_attachement_id" { - value = try(google_compute_service_attachment.default.id,null) + value = try(google_compute_service_attachment.default.id, null) } \ No newline at end of file diff --git a/modules/private_link/variables.tf b/modules/private_link/variables.tf index c2d54d63..7938714b 100644 --- a/modules/private_link/variables.tf +++ b/modules/private_link/variables.tf @@ -23,8 +23,8 @@ variable "subnetwork" { } variable "allowed_project_names" { - type = map(number) - default = {} + type = map(number) + default = {} description = "A map of allowed projects where each key is a project number and the value is the connection limit." } @@ -39,6 +39,6 @@ variable "proxynetwork_cidr" { } variable "forwarding_rule" { - type = string + type = string description = "forwarding rule name used in private service connect as a target" } \ No newline at end of file diff --git a/modules/redis/main.tf b/modules/redis/main.tf index c3740901..4a6ba4aa 100644 --- a/modules/redis/main.tf +++ b/modules/redis/main.tf @@ -2,10 +2,10 @@ data "google_compute_zones" "available" { } resource "google_redis_instance" "default" { - name = "${var.namespace}-redis" - display_name = "${var.namespace} W&B Instance" - tier = var.tier - memory_size_gb = var.memory_size_gb + name = "${var.namespace}-redis" + display_name = "${var.namespace} W&B Instance" + tier = var.tier + memory_size_gb = var.memory_size_gb customer_managed_key = var.crypto_key location_id = data.google_compute_zones.available.names.0 diff --git a/modules/service_accounts/outputs.tf b/modules/service_accounts/outputs.tf index b4e7e7f0..414ccfb2 100644 --- a/modules/service_accounts/outputs.tf +++ b/modules/service_accounts/outputs.tf @@ -1,5 +1,5 @@ output "service_account" { - value = google_service_account.main + value = google_service_account.main description = "The service account." } diff --git a/modules/storage/bucket/main.tf b/modules/storage/bucket/main.tf index 678d7d3c..1dd3a290 100644 --- a/modules/storage/bucket/main.tf +++ b/modules/storage/bucket/main.tf @@ -17,8 +17,8 @@ resource "google_storage_bucket" "file_storage" { force_destroy = !var.deletion_protection labels = var.labels - - dynamic "encryption" { + + dynamic "encryption" { for_each = var.crypto_key != null ? [1] : [] content { default_kms_key_name = var.crypto_key diff --git a/outputs.tf b/outputs.tf index 4a74ebc2..57c99898 100644 --- a/outputs.tf +++ b/outputs.tf @@ -92,8 +92,8 @@ output "database_instance_type" { output "private_attachement_id" { value = var.create_private_link ? module.private_link[0].private_attachement_id : null } - + output "sa_account_email" { - description = "This output provides the email address of the service account created for workload identity, if workload identity is enabled. Otherwise, it returns null" - value = var.create_workload_identity == true ? module.service_accounts.sa_account_role : null + description = "This output provides the email address of the service account created for workload identity, if workload identity is enabled. Otherwise, it returns null" + value = var.create_workload_identity == true ? module.service_accounts.sa_account_role : null } \ No newline at end of file diff --git a/variables.tf b/variables.tf index 8a688216..17cca5f3 100644 --- a/variables.tf +++ b/variables.tf @@ -150,7 +150,7 @@ variable "database_version" { variable "database_machine_type" { description = "Specifies the machine type to be allocated for the database. Defaults to null and value from deployment-size.tf is used" type = string - default = null + default = null } variable "database_sort_buffer_size" { @@ -189,7 +189,7 @@ variable "redis_tier" { variable "redis_memory_size_gb" { type = number description = "Specifies the memory size in GB for the Redis instance. Defaults to null and value from deployment-size.tf is used" - default = null + default = null } ########################################## @@ -217,20 +217,20 @@ variable "bucket_location" { variable "gke_machine_type" { description = "Specifies the machine type for nodes in the GKE cluster. Defaults to null and value from deployment-size.tf is used" type = string - default = null + default = null } variable "gke_min_node_count" { - type = number + type = number description = "Initial number of nodes for the GKE cluster, if gke_max_node_count is set, this is the minimum number of nodes. Defaults to null and value from deployment-size.tf is used" - default = null + default = null } variable "gke_max_node_count" { - type = number + type = number description = "Maximum number of nodes for the GKE cluster. Defaults to null and value from deployment-size.tf is used" - default = null + default = null } ########################################## diff --git a/versions.tf b/versions.tf index abffb147..ca2a9679 100644 --- a/versions.tf +++ b/versions.tf @@ -2,7 +2,7 @@ terraform { required_version = "~> 1.0" required_providers { time = { - source = "hashicorp/time" + source = "hashicorp/time" version = "0.11.2" } google = {