Sample Terraform script that can be used to enable the required APIs at each project level for Google Cloud monitoring
Use this sample Terraform script to enable the required APIs for each project. This Terraform script helps you enable all the required APIs for multiple projects in a single deployment.
- Main.tf
- provider "google" {
- project = "base project id"
- } module "project-services" {
- source = "terraform-google-modules/project-factory/google//modules/project_services"
- for_each=var.project_id_map
- project_id = "${each.value.project_id}"
- activate_apis = [
- "compute.googleapis.com",
- "cloudfunctions.googleapis.com",
- "dataproc.googleapis.com",
- "redis.googleapis.com",
- "container.googleapis.com",
- "spanner.googleapis.com",
- "appengine.googleapis.com",
- "pubsub.googleapis.com",
- "composer.googleapis.com",
- "monitoring.googleapis.com",
- "compute.googleapis.com",
- "dataflow.googleapis.com",
- "run.googleapis.com",
- "file.googleapis.com",
- "cloudkms.googleapis.com",
- "dns.googleapis.com",
- "cloudbilling.googleapis.com",
- "cloudresourcemanager.googleapis.com",
- "cloudasset.googleapis.com",
- "servicenetworking.googleapis.com",
- "appengine.googleapis.com",
- "container.googleapis.com",
- "sqladmin.googleapis.com",
- "cloudkms.googleapis.com"
- ]
- }
- variables.tf
- variable "project_id_map" {
- type = map(object({
- project_id = string
- }))
- default = {
- "Projectid_1" = {
- project_id = "project_1_id"
- }
- "Projectid_2" = {
- project_id = "project_2_id"
- }
- }
- }
Related Articles
Exclude Site24x7 monitoring traffic from Google Analytics
You can exclude traffic from the Site24x7 Web Transaction (Browser) monitor and Webpage Speed (Browser) traffic from Google Analytics in two ways. To exclude traffic for the Web Defacement monitor, you can follow the first method. 1. Creating a ...
Troubleshooting false positive alerts in monitoring
Problem False positive alerts are being generated. Possible cause The monitoring system is down in some locations. The Website monitor might be configured for one location, such as Seattle, but may appear down when accessed from another location, ...
Difference between website monitoring and REST API monitoring
Website monitoring allows you to monitor your websites and web applications to ensure that they are up and running. Website monitor verifies the availability of specified, addressable, standard HTTP and HTTPS URLs from over 100+ global locations and ...
Exclude the selective SSH algorithms in On-Premise Poller during SFTP Transfer monitoring
By excluding SSH algorithms, you can restrict Site24x7 SSH Client from using the excluded algorithm while connecting to the SSH server during SFTP Transfer monitoring. Follow the steps mentioned below for SSH algorithm exclusion in On-Premise Poller ...
Compare our various methodologies for Website Monitoring
Get to know Site24x7 monitors better and choose the one that best fits your monitoring needs. Compare the functionality of the following monitors: Website Monitoring Webpage Speed (Browser) Web Transaction Monitoring Web Transaction (Browser) SSL/TLS ...