Add metric scopes support (#397)

* Add metric scopes support

* Fix typo

* new tfdoc block in README

Co-authored-by: Ludovico Magnocavallo <ludomagno@google.com>
This commit is contained in:
Julio Castillo 2021-12-21 09:22:10 +01:00 committed by GitHub
parent b63114849b
commit 0c21fecff8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 0 deletions

View File

@ -11,6 +11,7 @@ All notable changes to this project will be documented in this file.
- **incompatible change** renamed `private_service_networking_range` variable to `psc_ranges` in `net-vpc`module, and changed its type to `list(string)`
- added a firewall policy factory to `organization` module
- refactored `tfdoc`
- added support for metric scopes to the `project` module
## [8.0.0] - 2021-10-21

View File

@ -193,6 +193,7 @@ module "project" {
| lien_reason | If non-empty, creates a project lien with this description. | <code>string</code> | | <code>&#34;&#34;</code> |
| logging_exclusions | Logging exclusions for this project in the form {NAME -> FILTER}. | <code>map&#40;string&#41;</code> | | <code>&#123;&#125;</code> |
| logging_sinks | Logging sinks to create for this project. | <code title="map&#40;object&#40;&#123;&#10; destination &#61; string&#10; type &#61; string&#10; filter &#61; string&#10; iam &#61; bool&#10; unique_writer &#61; bool&#10; exclusions &#61; map&#40;string&#41;&#10;&#125;&#41;&#41;">map&#40;object&#40;&#123;&#8230;&#125;&#41;&#41;</code> | | <code>&#123;&#125;</code> |
| metric_scopes | List of projects that will act as metric scopes for this project. | <code>list&#40;string&#41;</code> | | <code>null</code> |
| oslogin | Enable OS Login. | <code>bool</code> | | <code>false</code> |
| oslogin_admins | List of IAM-style identities that will be granted roles necessary for OS Login administrators. | <code>list&#40;string&#41;</code> | | <code>&#91;&#93;</code> |
| oslogin_users | List of IAM-style identities that will be granted roles necessary for OS Login users. | <code>list&#40;string&#41;</code> | | <code>&#91;&#93;</code> |

View File

@ -389,3 +389,10 @@ resource "google_kms_crypto_key_iam_member" "crypto_key" {
data.google_storage_project_service_account.gcs_sa,
]
}
resource "google_monitoring_monitored_project" "primary" {
provider = google-beta
for_each = toset(coalesce(var.metric_scopes, []))
metrics_scope = each.value
name = local.project.project_id
}

View File

@ -100,6 +100,12 @@ variable "logging_sinks" {
default = {}
}
variable "metric_scopes" {
description = "List of projects that will act as metric scopes for this project."
type = list(string)
default = null
}
variable "name" {
description = "Project name and id suffix."
type = string