diff --git a/examples/vpc_peering_common_with_autoscale/example.tfvars b/examples/vpc_peering_common_with_autoscale/example.tfvars index c2d0799..5bdf9af 100644 --- a/examples/vpc_peering_common_with_autoscale/example.tfvars +++ b/examples/vpc_peering_common_with_autoscale/example.tfvars @@ -221,9 +221,11 @@ autoscale_common = { autoscaler_metrics = { "custom.googleapis.com/VMSeries/panSessionUtilization" = { target = 70 + filter = "resource.type = \"gce_instance\"" } "custom.googleapis.com/VMSeries/panSessionThroughputKbps" = { target = 700000 + filter = "resource.type = \"gce_instance\"" } } } @@ -339,4 +341,5 @@ lbs_external = { http_health_check_port = "80" http_health_check_request_path = "/php/login.php" } -} \ No newline at end of file +} + diff --git a/examples/vpc_peering_dedicated_with_autoscale/example.tfvars b/examples/vpc_peering_dedicated_with_autoscale/example.tfvars index c77900a..128e5bc 100644 --- a/examples/vpc_peering_dedicated_with_autoscale/example.tfvars +++ b/examples/vpc_peering_dedicated_with_autoscale/example.tfvars @@ -221,9 +221,11 @@ autoscale_common = { autoscaler_metrics = { "custom.googleapis.com/VMSeries/panSessionUtilization" = { target = 70 + filter = "resource.type = \"gce_instance\"" } "custom.googleapis.com/VMSeries/panSessionThroughputKbps" = { target = 700000 + filter = "resource.type = \"gce_instance\"" } } } @@ -391,4 +393,5 @@ lbs_external = { http_health_check_port = "80" http_health_check_request_path = "/php/login.php" } -} \ No newline at end of file +} + diff --git a/modules/autoscale/main.tf b/modules/autoscale/main.tf index bed0762..a38827f 100644 --- a/modules/autoscale/main.tf +++ b/modules/autoscale/main.tf @@ -164,6 +164,7 @@ resource "google_compute_region_autoscaler" "regional" { name = metric.key type = try(metric.value.type, "GAUGE") target = metric.value.target + filter = try(metric.value.filter, null) } } @@ -374,4 +375,5 @@ resource "google_project_iam_member" "delicensing_cfn_invoker" { project = var.project_id role = "roles/run.invoker" member = "serviceAccount:${data.google_compute_default_service_account.main.email}" -} \ No newline at end of file +} +