diff --git a/README.md b/README.md index 68ddce4f..4df27247 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ No providers. | [app\_gke](#module\_app\_gke) | ./modules/app_gke | n/a | | [app\_lb](#module\_app\_lb) | ./modules/app_lb | n/a | | [database](#module\_database) | ./modules/database | n/a | -| [gke\_app](#module\_gke\_app) | wandb/wandb/kubernetes | 1.1.1 | +| [gke\_app](#module\_gke\_app) | wandb/wandb/kubernetes | 1.1.2 | | [kms](#module\_kms) | ./modules/kms | n/a | | [networking](#module\_networking) | ./modules/networking | n/a | | [project\_factory\_project\_services](#module\_project\_factory\_project\_services) | terraform-google-modules/project-factory/google//modules/project_services | ~> 13.0 | diff --git a/main.tf b/main.tf index b195689a..523f6f55 100644 --- a/main.tf +++ b/main.tf @@ -13,7 +13,9 @@ module "project_factory_project_services" { "redis.googleapis.com", // Redis "pubsub.googleapis.com", // File Storage "storage.googleapis.com", // Cloud Storage - "cloudkms.googleapis.com" // KMS + "cloudkms.googleapis.com", // KMS + "compute.googleapis.com", // required for datadog monitoring + "cloudasset.googleapis.com" // required for datadog monitoring ] } @@ -83,6 +85,7 @@ module "app_lb" { network = module.networking.network group = module.app_gke.instance_group_url service_account = module.service_accounts.service_account + labels = var.labels depends_on = [module.project_factory_project_services] } @@ -92,6 +95,7 @@ module "database" { database_version = var.database_version network_connection = module.networking.connection deletion_protection = var.deletion_protection + labels = var.labels depends_on = [module.project_factory_project_services] } @@ -101,6 +105,7 @@ module "redis" { namespace = var.namespace memory_size_gb = 4 network = module.networking.network + labels = var.labels } locals { @@ -112,7 +117,7 @@ locals { module "gke_app" { source = "wandb/wandb/kubernetes" - version = "1.1.1" + version = "1.1.2" license = var.license diff --git a/modules/app_lb/http/main.tf b/modules/app_lb/http/main.tf index 39a24c0b..a8374887 100644 --- a/modules/app_lb/http/main.tf +++ b/modules/app_lb/http/main.tf @@ -9,4 +9,6 @@ resource "google_compute_global_forwarding_rule" "default" { target = google_compute_target_http_proxy.default.id port_range = "80" ip_address = var.ip_address -} \ No newline at end of file + + labels = var.labels +} diff --git a/modules/app_lb/http/variables.tf b/modules/app_lb/http/variables.tf index e57418ea..50ce3b2d 100644 --- a/modules/app_lb/http/variables.tf +++ b/modules/app_lb/http/variables.tf @@ -9,4 +9,10 @@ variable "url_map" { variable "ip_address" { type = string -} \ No newline at end of file +} + +variable "labels" { + description = "Labels which will be applied to all applicable resources." + type = map(string) + default = {} +} diff --git a/modules/app_lb/https/main.tf b/modules/app_lb/https/main.tf index 8d3b8862..51648ebf 100644 --- a/modules/app_lb/https/main.tf +++ b/modules/app_lb/https/main.tf @@ -25,4 +25,6 @@ resource "google_compute_global_forwarding_rule" "default" { target = google_compute_target_https_proxy.default.id port_range = "443" ip_address = var.ip_address -} \ No newline at end of file + + labels = var.labels +} diff --git a/modules/app_lb/https/redirect.tf b/modules/app_lb/https/redirect.tf index 402c0d61..f6f3ace8 100644 --- a/modules/app_lb/https/redirect.tf +++ b/modules/app_lb/https/redirect.tf @@ -13,4 +13,6 @@ module "http" { namespace = var.namespace url_map = google_compute_url_map.redirect_to_https ip_address = var.ip_address -} \ No newline at end of file + + labels = var.labels +} diff --git a/modules/app_lb/https/variables.tf b/modules/app_lb/https/variables.tf index c31c25b1..f073137b 100644 --- a/modules/app_lb/https/variables.tf +++ b/modules/app_lb/https/variables.tf @@ -13,4 +13,10 @@ variable "ip_address" { variable "fqdn" { type = string -} \ No newline at end of file +} + +variable "labels" { + description = "Labels which will be applied to all applicable resources." + type = map(string) + default = {} +} diff --git a/modules/app_lb/main.tf b/modules/app_lb/main.tf index 13be04d3..8fbbeca5 100644 --- a/modules/app_lb/main.tf +++ b/modules/app_lb/main.tf @@ -19,6 +19,8 @@ module "http" { namespace = var.namespace url_map = module.url_map.app ip_address = google_compute_global_address.default.address + + labels = var.labels } module "https" { @@ -29,4 +31,6 @@ module "https" { namespace = var.namespace url_map = module.url_map.app ip_address = google_compute_global_address.default.address + + labels = var.labels } diff --git a/modules/app_lb/url_map/main.tf b/modules/app_lb/url_map/main.tf index 57992b90..71a2c60a 100644 --- a/modules/app_lb/url_map/main.tf +++ b/modules/app_lb/url_map/main.tf @@ -15,6 +15,10 @@ resource "google_compute_health_check" "gke_ingress" { port = var.target_port request_path = "/ready" } + + log_config { + enable = true + } } # This is an ingress rule that allows traffic from the Google Cloud health diff --git a/modules/app_lb/variables.tf b/modules/app_lb/variables.tf index 76c7601e..d47a847f 100644 --- a/modules/app_lb/variables.tf +++ b/modules/app_lb/variables.tf @@ -31,4 +31,10 @@ variable "target_port" { variable "network" { description = "Google Compute Engine network to which the cluster is connected." type = object({ self_link = string }) -} \ No newline at end of file +} + +variable "labels" { + description = "Labels which will be applied to all applicable resources." + type = map(string) + default = {} +} diff --git a/modules/storage/pubsub/main.tf b/modules/storage/pubsub/main.tf index 8599f887..1b0280b3 100644 --- a/modules/storage/pubsub/main.tf +++ b/modules/storage/pubsub/main.tf @@ -5,6 +5,7 @@ locals { resource "google_pubsub_topic" "file_storage" { name = "${var.namespace}-file-storage" kms_key_name = var.crypto_key.id + labels = var.labels } resource "google_pubsub_topic_iam_member" "admin" { @@ -16,6 +17,7 @@ resource "google_pubsub_topic_iam_member" "admin" { resource "google_pubsub_subscription" "file_storage" { name = "${var.namespace}-file-storage" topic = google_pubsub_topic.file_storage.name + labels = var.labels ack_deadline_seconds = 30 }