diff --git a/blueprints/cloud-operations/network-dashboard/README.md b/blueprints/cloud-operations/network-dashboard/README.md index c835dc01..cc0557c1 100644 --- a/blueprints/cloud-operations/network-dashboard/README.md +++ b/blueprints/cloud-operations/network-dashboard/README.md @@ -16,20 +16,25 @@ 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 = "project-0" # Monitoring project where the dashboard will be created and the solution deployed - 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 - v2 = 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 + cf_version = V1|V2 + # Set to V2 to use V2 Cloud Functions environment + ``` - `terraform init` - `terraform apply` Note: Org level viewing permission is required for some metrics such as firewall policies. -Once the resources are deployed, go to the following page to see the dashboard: https://console.cloud.google.com/monitoring/dashboards?project=. -A dashboard called "quotas-utilization" should be created. +Once the resources are deployed, go to the following page to see the dashboard: https://console.cloud.google.com/monitoring/dashboards?project= a dashboard called "quotas-utilization" should be created. The Cloud Function runs every 10 minutes by default so you should start getting some data points after a few minutes. You can use the metric explorer to view the data points for the different custom metrics created: https://console.cloud.google.com/monitoring/metrics-explorer?project=. @@ -69,7 +74,6 @@ Note that metrics are created in the cloud-function/metrics.yaml file. You can a - The CF assumes custom routes importing/exporting is ON, this impacts static and dynamic routes usage calculation - The CF assumes all networks in peering groups have the same global routing and custom routes sharing configuration - ## Next steps and ideas In a future release, we could support: - Google managed VPCs that are peered with PSA (such as Cloud SQL or Memorystore) @@ -87,13 +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#L47) | The organization id for the associated services | | ✓ | | -| [prefix](variables.tf#L51) | 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 | | [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 * * * * | +| [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 b5edfb5c..5710f25c 100644 --- a/blueprints/cloud-operations/network-dashboard/main.tf +++ b/blueprints/cloud-operations/network-dashboard/main.tf @@ -30,7 +30,7 @@ locals { module "project-monitoring" { count = var.monitoring_project_id == "" ? 1 : 0 source = "../../../modules/project" - name = "monitoring" + name = "network-dashboards" parent = "organizations/${var.organization_id}" prefix = var.prefix billing_account = var.billing_account diff --git a/blueprints/cloud-operations/network-dashboard/tests/variables.tf b/blueprints/cloud-operations/network-dashboard/tests/variables.tf index 5339712c..a895d284 100644 --- a/blueprints/cloud-operations/network-dashboard/tests/variables.tf +++ b/blueprints/cloud-operations/network-dashboard/tests/variables.tf @@ -36,7 +36,6 @@ variable "project_vm_services" { "servicenetworking.googleapis.com", ] } - variable "region" { description = "Region used to deploy subnets" default = "europe-west1" @@ -45,4 +44,4 @@ variable "region" { variable "zone" { description = "Zone used to deploy vms" default = "europe-west1-b" -} \ No newline at end of file +} diff --git a/blueprints/cloud-operations/network-dashboard/variables.tf b/blueprints/cloud-operations/network-dashboard/variables.tf index 94803f02..de32ab1e 100644 --- a/blueprints/cloud-operations/network-dashboard/variables.tf +++ b/blueprints/cloud-operations/network-dashboard/variables.tf @@ -43,7 +43,6 @@ variable "monitoring_project_id" { default = "" } - variable "organization_id" { description = "The organization id for the associated services" } @@ -59,19 +58,21 @@ variable "project_monitoring_services" { "cloudasset.googleapis.com", "cloudbilling.googleapis.com", "cloudbuild.googleapis.com", + "cloudfunctions.googleapis.com", "cloudresourcemanager.googleapis.com", "cloudscheduler.googleapis.com", "compute.googleapis.com", - "cloudfunctions.googleapis.com", "iam.googleapis.com", "iamcredentials.googleapis.com", "logging.googleapis.com", "monitoring.googleapis.com", + "pubsub.googleapis.com", "run.googleapis.com", - "serviceusage.googleapis.com" + "servicenetworking.googleapis.com", + "serviceusage.googleapis.com", + "storage-component.googleapis.com" ] } - variable "region" { description = "Region used to deploy the cloud functions and scheduler" default = "europe-west1"