Group class

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:

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\"")
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 main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v9/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
	})
}
pulumi {
  required_providers {
    gcp = {
      source = "pulumi/gcp"
    }
  }
}

resource "gcp_monitoring_group" "basic" {
  display_name = "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.ArrayList;
import java.util.Arrays;
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)
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 main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v9/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
	})
}
pulumi {
  required_providers {
    gcp = {
      source = "pulumi/gcp"
    }
  }
}

resource "gcp_monitoring_group" "parent" {
  display_name = "tf-test MonitoringParentGroup"
  filter       = "resource.metadata.region=\"europe-west2\""
}
resource "gcp_monitoring_group" "subgroup" {
  display_name = "tf-test MonitoringSubGroup"
  filter       = "resource.metadata.region=\"europe-west2\""
  parent_name  = gcp_monitoring_group.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.ArrayList;
import java.util.Arrays;
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}

Import

Group can be imported using any of these accepted formats:

  • {{project}}/{{name}}
  • {{project}} {{name}}
  • {{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 {{project}}/{{name}}
$ terraform import google_monitoring_group.default "{{project}} {{name}}"
$ pulumi import gcp:monitoring/group:Group default {{name}}

Constructors

Group(String name, {GroupArgs? args, CustomResourceOptions? options})
Creates a new Group. name The Pulumi resource name. args Arguments used to configure this Group. The set of arguments for Group. options Resource options controlling this resource's behavior.
Group.reference(String urn)
Creates a typed reference to an existing Group resource.

Properties

childResources → Set<Resource>
finalinherited
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
deletionPolicy ↔ Output<String>
Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
latefinal
displayName ↔ Output<String>
A user-assigned name for this group, used only for display purposes.
latefinal
filter ↔ Output<String>
The filter used to determine which monitored resources belong to this group.
latefinal
hashCode → int
The hash code for this object.
no setterinherited
id ↔ Output<String>
getter/setter pairinherited
isCluster ↔ Output<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.
latefinal
isCustom → bool
Returns whether this resource is provider-managed.
no setterinherited
isProtected → bool
Returns whether this resource is protected from deletion.
no setterinherited
isRemote → bool
Whether this resource is registered as remote.
no setterinherited
isResourceReference → bool
Whether this instance represents a resource value returned over RPC.
finalinherited
name ↔ Output<String>
A unique identifier for this group. The format is "projects/{project_id_or_number}/groups/{group_id}".
latefinal
parentName ↔ Output<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, "".
latefinal
project ↔ Output<String>
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
latefinal
resourceTransforms → List<ResourceTransform>
Inherited/explicit async transforms.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
transformations → List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
urn ↔ Output<String>
latefinalinherited

Methods

failId(Object error) → void
Completes this resource ID with an error when registration fails.
inherited
failOutputs(Object error) → void
Completes all output properties with error.
inherited
failUrn(Object error) → void
Completes this resource URN with an error when registration fails.
inherited
getProvider(String moduleMember) → ProviderResource?
Returns provider for moduleMember's package, if configured.
inherited
getResourceName() → String
Returns this resource's logical name.
inherited
getResourceType() → String
Returns this resource's Pulumi type token.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerOutput<T>(String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output<T>
Registers a dynamic output property for this resource.
inherited
resolveId(String? value, {required bool isKnown}) → void
Resolves the provider-assigned ID for this resource.
inherited
resolveOutputs(Struct outputs) → void
Resolves all output properties from a monitor response payload.
inherited
resolveUrn(String value) → void
Resolves this resource's URN once assigned by the engine.
inherited
serializeProperties(Map<String, dynamic> properties) → Future<Struct>
Serializes resource properties for RPC transmission.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

get(String name, Input<String> id, {GroupState? state, CustomResourceOptions? options}) → Group
Gets an existing Group resource's state with the given name and id.