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:
parent
b63114849b
commit
0c21fecff8
|
@ -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
|
||||
|
||||
|
|
|
@ -193,6 +193,7 @@ module "project" {
|
|||
| lien_reason | If non-empty, creates a project lien with this description. | <code>string</code> | | <code>""</code> |
|
||||
| logging_exclusions | Logging exclusions for this project in the form {NAME -> FILTER}. | <code>map(string)</code> | | <code>{}</code> |
|
||||
| logging_sinks | Logging sinks to create for this project. | <code title="map(object({ destination = string type = string filter = string iam = bool unique_writer = bool exclusions = map(string) }))">map(object({…}))</code> | | <code>{}</code> |
|
||||
| metric_scopes | List of projects that will act as metric scopes for this project. | <code>list(string)</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(string)</code> | | <code>[]</code> |
|
||||
| oslogin_users | List of IAM-style identities that will be granted roles necessary for OS Login users. | <code>list(string)</code> | | <code>[]</code> |
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue