diff --git a/blueprints/cloud-operations/network-dashboard/README.md b/blueprints/cloud-operations/network-dashboard/README.md index e3c51510e8..ca1c80dc9d 100644 --- a/blueprints/cloud-operations/network-dashboard/README.md +++ b/blueprints/cloud-operations/network-dashboard/README.md @@ -16,13 +16,17 @@ Three metric descriptors are created for each monitored resource: usage, limit a Clone this repository, then go through the following steps to create resources: - Create a terraform.tfvars file with the following content: ```tfvars - - organization_id = "" - - billing_account = "" - - monitoring_project_id = "" # Monitoring project where the dashboard will be created and the solution deployed, a project named "mon-network-dahshboard" will be created if left blank - - monitored_projects_list = ["project-1", "project2"] # Projects to be monitored by the solution - - monitored_folders_list = ["folder_id"] # Folders to be monitored by the solution - - prefix = "" # Monitoring project name prefix, monitoring project name is -network-dashboard, ignored if monitoring_project_id variable is provided - - v2 = true|false # Set to true to use V2 Cloud Functions environment + organization_id = "" + billing_account = "" + monitoring_project_id = "" + # Monitoring project where the dashboard will be created and the solution deployed, a project named "mon-network-dahshboard" will be created if left blank + monitored_projects_list = ["project-1", "project2"] + # Projects to be monitored by the solution + monitored_folders_list = ["folder_id"] + # Folders to be monitored by the solution + prefix = "" + # Monitoring project name prefix, monitoring project name is -network-dashboard, ignored if monitoring_project_id variable is provided + v2 = true|false # Set to true to use V2 Cloud Functions environment ``` - `terraform init` - `terraform apply` @@ -87,15 +91,13 @@ If you are interested in this and/or would like to contribute, please contact le |---|---|:---:|:---:|:---:| | [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#L54) | The organization id for the associated services | | ✓ | | -| [prefix](variables.tf#L58) | Customer name to use as prefix for monitoring project | | ✓ | | +| [organization_id](variables.tf#L46) | The organization id for the associated services | | ✓ | | +| [prefix](variables.tf#L50) | 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 | -| [metrics_project_id](variables.tf#L46) | Optional, populate to write metrics and deploy the dashboard in a separated project | | | | | [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, if metrics_project_id is provided, metrics and dashboard will be deployed there | | | | -| [project_monitoring_services](variables.tf#L63) | Service APIs enabled in the monitoring project if it will be created. | | | […] | -| [region](variables.tf#L88) | Region used to deploy the cloud functions and scheduler | | | europe-west1 | -| [schedule_cron](variables.tf#L93) | Cron format schedule to run the Cloud Function. Default is every 10 minutes. | | | */10 * * * * | -| [vpc_connector_name](variables.tf#L99) | Serverless VPC connection name for the Cloud Function | | | | +| [project_monitoring_services](variables.tf#L54) | Service APIs enabled in the monitoring project if it will be created. | | | […] | +| [region](variables.tf#L76) | Region used to deploy the cloud functions and scheduler | | | europe-west1 | +| [schedule_cron](variables.tf#L81) | Cron format schedule to run the Cloud Function. Default is every 10 minutes. | | | */10 * * * * | diff --git a/blueprints/cloud-operations/network-dashboard/main.tf b/blueprints/cloud-operations/network-dashboard/main.tf index 2b8acbbf1a..d4e587c180 100644 --- a/blueprints/cloud-operations/network-dashboard/main.tf +++ b/blueprints/cloud-operations/network-dashboard/main.tf @@ -21,7 +21,6 @@ locals { folder_ids = toset(var.monitored_folders_list) folders = join(",", local.folder_ids) monitoring_project = var.monitoring_project_id == "" ? module.project-monitoring[0].project_id : var.monitoring_project_id - metrics_project = var.metrics_project_id == "" ? (var.monitoring_project_id == "" ? module.project-monitoring[0].project_id : var.monitoring_project_id) : var.metrics_project_id } ################################################ @@ -61,7 +60,7 @@ module "service-account-function" { } iam_project_roles = { - "${local.metrics_project}" = [ + "${local.monitoring_project}" = [ "roles/monitoring.metricWriter", ] } @@ -168,7 +167,7 @@ module "cloud-function" { environment_variables = { MONITORED_PROJECTS_LIST = local.projects MONITORED_FOLDERS_LIST = local.folders - MONITORING_PROJECT_ID = local.metrics_project + MONITORING_PROJECT_ID = local.monitoring_project ORGANIZATION_ID = var.organization_id CF_VERSION = var.cf_version } @@ -190,9 +189,5 @@ module "cloud-function" { resource "google_monitoring_dashboard" "dashboard" { dashboard_json = file("${path.module}/dashboards/quotas-utilization.json") -<<<<<<< HEAD - project = local.metrics_project -======= project = local.monitoring_project ->>>>>>> b7bfcf3575cda18a2fdd2862c72e33c1648c0aa4 } diff --git a/blueprints/cloud-operations/network-dashboard/variables.tf b/blueprints/cloud-operations/network-dashboard/variables.tf index 6100d4a7d9..1f07116aa2 100644 --- a/blueprints/cloud-operations/network-dashboard/variables.tf +++ b/blueprints/cloud-operations/network-dashboard/variables.tf @@ -43,24 +43,14 @@ variable "monitoring_project_id" { default = "" } -variable "metrics_project_id" { - description = "Optional, populate to write metrics and deploy the dashboard in a separated project" - default = "" -} - - - - variable "organization_id" { description = "The organization id for the associated services" } variable "prefix" { description = "Customer name to use as prefix for monitoring project" - default = "mon" } - variable "project_monitoring_services" { description = "Service APIs enabled in the monitoring project if it will be created." default = [ @@ -83,9 +73,6 @@ variable "project_monitoring_services" { "storage-component.googleapis.com" ] } - - - variable "region" { description = "Region used to deploy the cloud functions and scheduler" default = "europe-west1" @@ -95,13 +82,3 @@ variable "schedule_cron" { description = "Cron format schedule to run the Cloud Function. Default is every 10 minutes." default = "*/10 * * * *" } - - -variable "vpc_connector_name" { - description = "Serverless VPC connection name for the Cloud Function" - default = "" -} - - - -