gcp.monitoring.Group
Explore with Pulumi AI
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
- How-to Guides
Example Usage
Monitoring Group Basic
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const basic = new gcp.monitoring.Group("basic", {
displayName: "tf-test MonitoringGroup",
filter: "resource.metadata.region=\"europe-west2\"",
});
import pulumi
import pulumi_gcp as gcp
basic = gcp.monitoring.Group("basic",
display_name="tf-test MonitoringGroup",
filter="resource.metadata.region=\"europe-west2\"")
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/monitoring"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := monitoring.NewGroup(ctx, "basic", &monitoring.GroupArgs{
DisplayName: pulumi.String("tf-test MonitoringGroup"),
Filter: pulumi.String("resource.metadata.region=\"europe-west2\""),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var basic = new Gcp.Monitoring.Group("basic", new()
{
DisplayName = "tf-test MonitoringGroup",
Filter = "resource.metadata.region=\"europe-west2\"",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.monitoring.Group;
import com.pulumi.gcp.monitoring.GroupArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var basic = new Group("basic", GroupArgs.builder()
.displayName("tf-test MonitoringGroup")
.filter("resource.metadata.region=\"europe-west2\"")
.build());
}
}
resources:
basic:
type: gcp:monitoring:Group
properties:
displayName: tf-test MonitoringGroup
filter: resource.metadata.region="europe-west2"
Monitoring Group Subgroup
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const parent = new gcp.monitoring.Group("parent", {
displayName: "tf-test MonitoringParentGroup",
filter: "resource.metadata.region=\"europe-west2\"",
});
const subgroup = new gcp.monitoring.Group("subgroup", {
displayName: "tf-test MonitoringSubGroup",
filter: "resource.metadata.region=\"europe-west2\"",
parentName: parent.name,
});
import pulumi
import pulumi_gcp as gcp
parent = gcp.monitoring.Group("parent",
display_name="tf-test MonitoringParentGroup",
filter="resource.metadata.region=\"europe-west2\"")
subgroup = gcp.monitoring.Group("subgroup",
display_name="tf-test MonitoringSubGroup",
filter="resource.metadata.region=\"europe-west2\"",
parent_name=parent.name)
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/monitoring"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
parent, err := monitoring.NewGroup(ctx, "parent", &monitoring.GroupArgs{
DisplayName: pulumi.String("tf-test MonitoringParentGroup"),
Filter: pulumi.String("resource.metadata.region=\"europe-west2\""),
})
if err != nil {
return err
}
_, err = monitoring.NewGroup(ctx, "subgroup", &monitoring.GroupArgs{
DisplayName: pulumi.String("tf-test MonitoringSubGroup"),
Filter: pulumi.String("resource.metadata.region=\"europe-west2\""),
ParentName: parent.Name,
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var parent = new Gcp.Monitoring.Group("parent", new()
{
DisplayName = "tf-test MonitoringParentGroup",
Filter = "resource.metadata.region=\"europe-west2\"",
});
var subgroup = new Gcp.Monitoring.Group("subgroup", new()
{
DisplayName = "tf-test MonitoringSubGroup",
Filter = "resource.metadata.region=\"europe-west2\"",
ParentName = parent.Name,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.monitoring.Group;
import com.pulumi.gcp.monitoring.GroupArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var parent = new Group("parent", GroupArgs.builder()
.displayName("tf-test MonitoringParentGroup")
.filter("resource.metadata.region=\"europe-west2\"")
.build());
var subgroup = new Group("subgroup", GroupArgs.builder()
.displayName("tf-test MonitoringSubGroup")
.filter("resource.metadata.region=\"europe-west2\"")
.parentName(parent.name())
.build());
}
}
resources:
parent:
type: gcp:monitoring:Group
properties:
displayName: tf-test MonitoringParentGroup
filter: resource.metadata.region="europe-west2"
subgroup:
type: gcp:monitoring:Group
properties:
displayName: tf-test MonitoringSubGroup
filter: resource.metadata.region="europe-west2"
parentName: ${parent.name}
Create Group Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Group(name: string, args: GroupArgs, opts?: CustomResourceOptions);
@overload
def Group(resource_name: str,
args: GroupArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Group(resource_name: str,
opts: Optional[ResourceOptions] = None,
display_name: Optional[str] = None,
filter: Optional[str] = None,
is_cluster: Optional[bool] = None,
parent_name: Optional[str] = None,
project: Optional[str] = None)
func NewGroup(ctx *Context, name string, args GroupArgs, opts ...ResourceOption) (*Group, error)
public Group(string name, GroupArgs args, CustomResourceOptions? opts = null)
type: gcp:monitoring:Group
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args GroupArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args GroupArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args GroupArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args GroupArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args GroupArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var examplegroupResourceResourceFromMonitoringgroup = new Gcp.Monitoring.Group("examplegroupResourceResourceFromMonitoringgroup", new()
{
DisplayName = "string",
Filter = "string",
IsCluster = false,
ParentName = "string",
Project = "string",
});
example, err := monitoring.NewGroup(ctx, "examplegroupResourceResourceFromMonitoringgroup", &monitoring.GroupArgs{
DisplayName: pulumi.String("string"),
Filter: pulumi.String("string"),
IsCluster: pulumi.Bool(false),
ParentName: pulumi.String("string"),
Project: pulumi.String("string"),
})
var examplegroupResourceResourceFromMonitoringgroup = new Group("examplegroupResourceResourceFromMonitoringgroup", GroupArgs.builder()
.displayName("string")
.filter("string")
.isCluster(false)
.parentName("string")
.project("string")
.build());
examplegroup_resource_resource_from_monitoringgroup = gcp.monitoring.Group("examplegroupResourceResourceFromMonitoringgroup",
display_name="string",
filter="string",
is_cluster=False,
parent_name="string",
project="string")
const examplegroupResourceResourceFromMonitoringgroup = new gcp.monitoring.Group("examplegroupResourceResourceFromMonitoringgroup", {
displayName: "string",
filter: "string",
isCluster: false,
parentName: "string",
project: "string",
});
type: gcp:monitoring:Group
properties:
displayName: string
filter: string
isCluster: false
parentName: string
project: string
Group Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The Group resource accepts the following input properties:
- Display
Name string - A user-assigned name for this group, used only for display purposes.
- Filter string
- The filter used to determine which monitored resources
belong to this group.
- Is
Cluster bool - If true, the members of this group are considered to be a cluster. The system can perform additional analysis on groups that are clusters.
- Parent
Name string - 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, "".
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Display
Name string - A user-assigned name for this group, used only for display purposes.
- Filter string
- The filter used to determine which monitored resources
belong to this group.
- Is
Cluster bool - If true, the members of this group are considered to be a cluster. The system can perform additional analysis on groups that are clusters.
- Parent
Name string - 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, "".
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- display
Name String - A user-assigned name for this group, used only for display purposes.
- filter String
- The filter used to determine which monitored resources
belong to this group.
- is
Cluster Boolean - If true, the members of this group are considered to be a cluster. The system can perform additional analysis on groups that are clusters.
- parent
Name String - 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, "".
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- display
Name string - A user-assigned name for this group, used only for display purposes.
- filter string
- The filter used to determine which monitored resources
belong to this group.
- is
Cluster boolean - If true, the members of this group are considered to be a cluster. The system can perform additional analysis on groups that are clusters.
- parent
Name string - 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, "".
- project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- display_
name str - A user-assigned name for this group, used only for display purposes.
- filter str
- The filter used to determine which monitored resources
belong to this group.
- is_
cluster bool - If true, the members of this group are considered to be a cluster. The system can perform additional analysis on groups that are clusters.
- parent_
name str - 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, "".
- project str
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- display
Name String - A user-assigned name for this group, used only for display purposes.
- filter String
- The filter used to determine which monitored resources
belong to this group.
- is
Cluster Boolean - If true, the members of this group are considered to be a cluster. The system can perform additional analysis on groups that are clusters.
- parent
Name String - 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, "".
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Outputs
All input properties are implicitly available as output properties. Additionally, the Group resource produces the following output properties:
Look up Existing Group Resource
Get an existing Group resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: GroupState, opts?: CustomResourceOptions): Group
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
display_name: Optional[str] = None,
filter: Optional[str] = None,
is_cluster: Optional[bool] = None,
name: Optional[str] = None,
parent_name: Optional[str] = None,
project: Optional[str] = None) -> Group
func GetGroup(ctx *Context, name string, id IDInput, state *GroupState, opts ...ResourceOption) (*Group, error)
public static Group Get(string name, Input<string> id, GroupState? state, CustomResourceOptions? opts = null)
public static Group get(String name, Output<String> id, GroupState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Display
Name string - A user-assigned name for this group, used only for display purposes.
- Filter string
- The filter used to determine which monitored resources
belong to this group.
- Is
Cluster bool - If true, the members of this group are considered to be a cluster. The system can perform additional analysis on groups that are clusters.
- Name string
- A unique identifier for this group. The format is "projects/{project_id_or_number}/groups/{group_id}".
- Parent
Name string - 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, "".
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Display
Name string - A user-assigned name for this group, used only for display purposes.
- Filter string
- The filter used to determine which monitored resources
belong to this group.
- Is
Cluster bool - If true, the members of this group are considered to be a cluster. The system can perform additional analysis on groups that are clusters.
- Name string
- A unique identifier for this group. The format is "projects/{project_id_or_number}/groups/{group_id}".
- Parent
Name string - 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, "".
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- display
Name String - A user-assigned name for this group, used only for display purposes.
- filter String
- The filter used to determine which monitored resources
belong to this group.
- is
Cluster Boolean - If true, the members of this group are considered to be a cluster. The system can perform additional analysis on groups that are clusters.
- name String
- A unique identifier for this group. The format is "projects/{project_id_or_number}/groups/{group_id}".
- parent
Name String - 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, "".
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- display
Name string - A user-assigned name for this group, used only for display purposes.
- filter string
- The filter used to determine which monitored resources
belong to this group.
- is
Cluster boolean - If true, the members of this group are considered to be a cluster. The system can perform additional analysis on groups that are clusters.
- name string
- A unique identifier for this group. The format is "projects/{project_id_or_number}/groups/{group_id}".
- parent
Name string - 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, "".
- project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- display_
name str - A user-assigned name for this group, used only for display purposes.
- filter str
- The filter used to determine which monitored resources
belong to this group.
- is_
cluster bool - If true, the members of this group are considered to be a cluster. The system can perform additional analysis on groups that are clusters.
- name str
- A unique identifier for this group. The format is "projects/{project_id_or_number}/groups/{group_id}".
- parent_
name str - 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, "".
- project str
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- display
Name String - A user-assigned name for this group, used only for display purposes.
- filter String
- The filter used to determine which monitored resources
belong to this group.
- is
Cluster Boolean - If true, the members of this group are considered to be a cluster. The system can perform additional analysis on groups that are clusters.
- name String
- A unique identifier for this group. The format is "projects/{project_id_or_number}/groups/{group_id}".
- parent
Name String - 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, "".
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Import
Group can be imported using any of these accepted formats:
{{name}}
When using the pulumi import
command, Group can be imported using one of the formats above. For example:
$ pulumi import gcp:monitoring/group:Group default {{name}}
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Google Cloud (GCP) Classic pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
google-beta
Terraform Provider.