| --- |
| # ---------------------------------------------------------------------------- |
| # |
| # *** AUTO GENERATED CODE *** Type: MMv1 *** |
| # |
| # ---------------------------------------------------------------------------- |
| # |
| # This file is automatically generated by Magic Modules and manual |
| # changes will be clobbered when the file is regenerated. |
| # |
| # Please read more about how to change this file in |
| # .github/CONTRIBUTING.md. |
| # |
| # ---------------------------------------------------------------------------- |
| subcategory: "Cloud (Stackdriver) Monitoring" |
| description: |- |
| The description of a dynamic collection of monitored resources. |
| --- |
| |
| # google\_monitoring\_group |
| |
| The description of a dynamic collection of monitored resources. Each group |
| has a filter that is matched against monitored resources and their |
| associated metadata. If a group's filter matches an available monitored |
| resource, then that resource is a member of that group. |
| |
| |
| To get more information about Group, see: |
| |
| * [API documentation](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.groups) |
| * How-to Guides |
| * [Official Documentation](https://cloud.google.com/monitoring/groups/) |
| |
| <div class = "oics-button" style="float: right; margin: 0 0 -15px"> |
| <a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_working_dir=monitoring_group_basic&cloudshell_image=gcr.io%2Fcloudshell-images%2Fcloudshell%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" target="_blank"> |
| <img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;"> |
| </a> |
| </div> |
| ## Example Usage - Monitoring Group Basic |
| |
| |
| ```hcl |
| resource "google_monitoring_group" "basic" { |
| display_name = "tf-test MonitoringGroup" |
| |
| filter = "resource.metadata.region=\"europe-west2\"" |
| } |
| ``` |
| <div class = "oics-button" style="float: right; margin: 0 0 -15px"> |
| <a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_working_dir=monitoring_group_subgroup&cloudshell_image=gcr.io%2Fcloudshell-images%2Fcloudshell%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" target="_blank"> |
| <img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;"> |
| </a> |
| </div> |
| ## Example Usage - Monitoring Group Subgroup |
| |
| |
| ```hcl |
| resource "google_monitoring_group" "parent" { |
| display_name = "tf-test MonitoringParentGroup" |
| filter = "resource.metadata.region=\"europe-west2\"" |
| } |
| |
| resource "google_monitoring_group" "subgroup" { |
| display_name = "tf-test MonitoringSubGroup" |
| filter = "resource.metadata.region=\"europe-west2\"" |
| parent_name = google_monitoring_group.parent.name |
| } |
| ``` |
| |
| ## Argument Reference |
| |
| The following arguments are supported: |
| |
| |
| * `display_name` - |
| (Required) |
| A user-assigned name for this group, used only for display |
| purposes. |
| |
| * `filter` - |
| (Required) |
| The filter used to determine which monitored resources |
| belong to this group. |
| |
| |
| - - - |
| |
| |
| * `parent_name` - |
| (Optional) |
| The name of the group's parent, if it has one. The format is |
| "projects/{project_id_or_number}/groups/{group_id}". For |
| groups with no parent, parentName is the empty string, "". |
| |
| * `is_cluster` - |
| (Optional) |
| If true, the members of this group are considered to be a |
| cluster. The system can perform additional analysis on |
| groups that are clusters. |
| |
| * `project` - (Optional) The ID of the project in which the resource belongs. |
| If it is not provided, the provider project is used. |
| |
| |
| ## Attributes Reference |
| |
| In addition to the arguments listed above, the following computed attributes are exported: |
| |
| * `id` - an identifier for the resource with format `{{name}}` |
| |
| * `name` - |
| A unique identifier for this group. The format is |
| "projects/{project_id_or_number}/groups/{group_id}". |
| |
| |
| ## Timeouts |
| |
| This resource provides the following |
| [Timeouts](https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/retries-and-customizable-timeouts) configuration options: |
| |
| - `create` - Default is 20 minutes. |
| - `update` - Default is 20 minutes. |
| - `delete` - Default is 20 minutes. |
| |
| ## Import |
| |
| |
| Group can be imported using any of these accepted formats: |
| |
| * `{{name}}` |
| |
| |
| In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Group using one of the formats above. For example: |
| |
| ```tf |
| import { |
| id = "{{name}}" |
| to = google_monitoring_group.default |
| } |
| ``` |
| |
| When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), Group can be imported using one of the formats above. For example: |
| |
| ``` |
| $ terraform import google_monitoring_group.default {{name}} |
| ``` |
| |
| ## User Project Overrides |
| |
| This resource supports [User Project Overrides](https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/provider_reference#user_project_override). |