From 21152c3c45070c2bfec5b5c0d43307e594de8d40 Mon Sep 17 00:00:00 2001 From: Julio Castillo Date: Thu, 20 Oct 2022 14:31:40 +0200 Subject: [PATCH 1/4] Improve net dashboard variables --- .../network-dashboard/README.md | 19 ++++++++ .../network-dashboard/variables.tf | 47 ++++++++++--------- 2 files changed, 45 insertions(+), 21 deletions(-) diff --git a/blueprints/cloud-operations/network-dashboard/README.md b/blueprints/cloud-operations/network-dashboard/README.md index d592238dad..7d873d5e0e 100644 --- a/blueprints/cloud-operations/network-dashboard/README.md +++ b/blueprints/cloud-operations/network-dashboard/README.md @@ -64,3 +64,22 @@ In a future release, we could support: - Google managed VPCs that are peered with PSA (such as Cloud SQL or Memorystore) If you are interested in this and/or would like to contribute, please contact legranda@google.com. + + + +## Variables + +| name | description | type | required | default | +|---|---|:---:|:---:|:---:| +| [billing_account](variables.tf#L21) | The ID of the billing account to associate this project with | | ✓ | | +| [monitored_projects_list](variables.tf#L34) | ID of the projects to be monitored (where limits and quotas data will be pulled) | list(string) | ✓ | | +| [organization_id](variables.tf#L17) | The organization id for the associated services | | ✓ | | +| [prefix](variables.tf#L30) | Customer name to use as prefix for monitoring project | | ✓ | | +| [cf_version](variables.tf#L75) | Cloud Function version 2nd Gen or 1st Gen. Possible options: 'V1' or 'V2'.Use CFv2 if your Cloud Function timeouts after 9 minutes. By default it is using CFv1. | | | V1 | +| [monitored_folders_list](variables.tf#L39) | ID of the projects to be monitored (where limits and quotas data will be pulled) | list(string) | | [] | +| [monitoring_project_id](variables.tf#L25) | Monitoring project where the dashboard will be created and the solution deployed; a project will be created if set to empty string | | | | +| [project_monitoring_services](variables.tf#L50) | Service APIs enabled in the monitoring project if it will be created. | | | […] | +| [region](variables.tf#L70) | Region used to deploy the cloud functions and scheduler | | | europe-west1 | +| [schedule_cron](variables.tf#L45) | Cron format schedule to run the Cloud Function. Default is every 5 minutes. | | | */10 * * * * | + + diff --git a/blueprints/cloud-operations/network-dashboard/variables.tf b/blueprints/cloud-operations/network-dashboard/variables.tf index 0929b69cb4..9740894a19 100644 --- a/blueprints/cloud-operations/network-dashboard/variables.tf +++ b/blueprints/cloud-operations/network-dashboard/variables.tf @@ -14,22 +14,23 @@ * limitations under the License. */ -variable "organization_id" { - description = "The organization id for the associated services" -} - variable "billing_account" { description = "The ID of the billing account to associate this project with" } -variable "monitoring_project_id" { - description = "Monitoring project where the dashboard will be created and the solution deployed; a project will be created if set to empty string" - default = "" +variable "cf_version" { + description = "Cloud Function version 2nd Gen or 1st Gen. Possible options: 'V1' or 'V2'.Use CFv2 if your Cloud Function timeouts after 9 minutes. By default it is using CFv1." + default = "V1" + validation { + condition = var.cf_version == "V1" || var.cf_version == "v2" + error_message = "The value of cf_version must be either V1 or V2." + } } -variable "prefix" { - description = "Customer name to use as prefix for monitoring project" - default = "" +variable "monitored_folders_list" { + type = list(string) + description = "ID of the projects to be monitored (where limits and quotas data will be pulled)" + default = [] } variable "monitored_projects_list" { @@ -37,15 +38,18 @@ variable "monitored_projects_list" { description = "ID of the projects to be monitored (where limits and quotas data will be pulled)" } -variable "monitored_folders_list" { - type = list(string) - description = "ID of the projects to be monitored (where limits and quotas data will be pulled)" - default = [] +variable "monitoring_project_id" { + description = "Monitoring project where the dashboard will be created and the solution deployed; a project will be created if set to empty string" + default = "" } -variable "schedule_cron" { - description = "Cron format schedule to run the Cloud Function. Default is every 5 minutes." - default = "*/10 * * * *" + +variable "organization_id" { + description = "The organization id for the associated services" +} + +variable "prefix" { + description = "Customer name to use as prefix for monitoring project" } variable "project_monitoring_services" { @@ -72,7 +76,8 @@ variable "region" { description = "Region used to deploy the cloud functions and scheduler" default = "europe-west1" } -variable "cf_version" { - description = "Cloud Function version 2nd Gen or 1st Gen. Possible options: 'V1' or 'V2'.Use CFv2 if your Cloud Function timeouts after 9 minutes. By default it is using CFv1." - default = "V1" -} \ No newline at end of file + +variable "schedule_cron" { + description = "Cron format schedule to run the Cloud Function. Default is every 5 minutes." + default = "*/10 * * * *" +} From 2d7319c4e8bad90dd10c6668cd872abedde8fd3f Mon Sep 17 00:00:00 2001 From: Julio Castillo Date: Thu, 20 Oct 2022 14:55:08 +0200 Subject: [PATCH 2/4] Fix cron description --- blueprints/cloud-operations/network-dashboard/variables.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blueprints/cloud-operations/network-dashboard/variables.tf b/blueprints/cloud-operations/network-dashboard/variables.tf index 9740894a19..6e42f140e5 100644 --- a/blueprints/cloud-operations/network-dashboard/variables.tf +++ b/blueprints/cloud-operations/network-dashboard/variables.tf @@ -78,6 +78,6 @@ variable "region" { } variable "schedule_cron" { - description = "Cron format schedule to run the Cloud Function. Default is every 5 minutes." + description = "Cron format schedule to run the Cloud Function. Default is every 10 minutes." default = "*/10 * * * *" } From ea9227dedff0ab96963da02f90b0085ad538729b Mon Sep 17 00:00:00 2001 From: Julio Castillo Date: Thu, 20 Oct 2022 14:55:45 +0200 Subject: [PATCH 3/4] Update README --- .../network-dashboard/README.md | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/blueprints/cloud-operations/network-dashboard/README.md b/blueprints/cloud-operations/network-dashboard/README.md index 7d873d5e0e..4253f806df 100644 --- a/blueprints/cloud-operations/network-dashboard/README.md +++ b/blueprints/cloud-operations/network-dashboard/README.md @@ -64,22 +64,21 @@ In a future release, we could support: - Google managed VPCs that are peered with PSA (such as Cloud SQL or Memorystore) If you are interested in this and/or would like to contribute, please contact legranda@google.com. - ## Variables | name | description | type | required | default | |---|---|:---:|:---:|:---:| -| [billing_account](variables.tf#L21) | The ID of the billing account to associate this project with | | ✓ | | -| [monitored_projects_list](variables.tf#L34) | ID of the projects to be monitored (where limits and quotas data will be pulled) | list(string) | ✓ | | -| [organization_id](variables.tf#L17) | The organization id for the associated services | | ✓ | | -| [prefix](variables.tf#L30) | Customer name to use as prefix for monitoring project | | ✓ | | -| [cf_version](variables.tf#L75) | Cloud Function version 2nd Gen or 1st Gen. Possible options: 'V1' or 'V2'.Use CFv2 if your Cloud Function timeouts after 9 minutes. By default it is using CFv1. | | | V1 | -| [monitored_folders_list](variables.tf#L39) | ID of the projects to be monitored (where limits and quotas data will be pulled) | list(string) | | [] | -| [monitoring_project_id](variables.tf#L25) | Monitoring project where the dashboard will be created and the solution deployed; a project will be created if set to empty string | | | | -| [project_monitoring_services](variables.tf#L50) | Service APIs enabled in the monitoring project if it will be created. | | | […] | -| [region](variables.tf#L70) | Region used to deploy the cloud functions and scheduler | | | europe-west1 | -| [schedule_cron](variables.tf#L45) | Cron format schedule to run the Cloud Function. Default is every 5 minutes. | | | */10 * * * * | +| [billing_account](variables.tf#L17) | The ID of the billing account to associate this project with | | ✓ | | +| [monitored_projects_list](variables.tf#L36) | ID of the projects to be monitored (where limits and quotas data will be pulled) | list(string) | ✓ | | +| [organization_id](variables.tf#L47) | The organization id for the associated services | | ✓ | | +| [prefix](variables.tf#L51) | Customer name to use as prefix for monitoring project | | ✓ | | +| [cf_version](variables.tf#L21) | Cloud Function version 2nd Gen or 1st Gen. Possible options: 'V1' or 'V2'.Use CFv2 if your Cloud Function timeouts after 9 minutes. By default it is using CFv1. | | | V1 | +| [monitored_folders_list](variables.tf#L30) | ID of the projects to be monitored (where limits and quotas data will be pulled) | list(string) | | [] | +| [monitoring_project_id](variables.tf#L41) | Monitoring project where the dashboard will be created and the solution deployed; a project will be created if set to empty string | | | | +| [project_monitoring_services](variables.tf#L55) | Service APIs enabled in the monitoring project if it will be created. | | | […] | +| [region](variables.tf#L75) | Region used to deploy the cloud functions and scheduler | | | europe-west1 | +| [schedule_cron](variables.tf#L80) | Cron format schedule to run the Cloud Function. Default is every 10 minutes. | | | */10 * * * * | From f8208670e2cb9c795803ec04cec83d14e30b23d2 Mon Sep 17 00:00:00 2001 From: Julio Castillo Date: Thu, 20 Oct 2022 19:12:57 +0200 Subject: [PATCH 4/4] Fix variable cf_version validation --- blueprints/cloud-operations/network-dashboard/variables.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blueprints/cloud-operations/network-dashboard/variables.tf b/blueprints/cloud-operations/network-dashboard/variables.tf index 6e42f140e5..94803f027e 100644 --- a/blueprints/cloud-operations/network-dashboard/variables.tf +++ b/blueprints/cloud-operations/network-dashboard/variables.tf @@ -22,7 +22,7 @@ variable "cf_version" { description = "Cloud Function version 2nd Gen or 1st Gen. Possible options: 'V1' or 'V2'.Use CFv2 if your Cloud Function timeouts after 9 minutes. By default it is using CFv1." default = "V1" validation { - condition = var.cf_version == "V1" || var.cf_version == "v2" + condition = var.cf_version == "V1" || var.cf_version == "V2" error_message = "The value of cf_version must be either V1 or V2." } }