Module monitoring

@pulumi/gcp > monitoring

class AlertPolicy

extends CustomResource

A description of the conditions under which some aspect of your system is considered to be “unhealthy” and the ways to notify people or services about this state.

To get more information about AlertPolicy, see:

Example Usage - Monitoring Alert Policy Basic

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const alertPolicy = new gcp.monitoring.AlertPolicy("alert_policy", {
    combiner: "OR",
    conditions: [{
        conditionThreshold: {
            aggregations: [{
                alignmentPeriod: "60s",
                perSeriesAligner: "ALIGN_RATE",
            }],
            comparison: "COMPARISON_GT",
            duration: "60s",
            filter: "metric.type=\"compute.googleapis.com/instance/disk/write_bytes_count\" AND resource.type=\"gce_instance\"",
        },
        displayName: "test condition",
    }],
    displayName: "My Alert Policy",
});

constructor

new AlertPolicy(name: string, args: AlertPolicyArgs, opts?: pulumi.CustomResourceOptions)

Create a AlertPolicy resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: AlertPolicyState, opts?: pulumi.CustomResourceOptions): AlertPolicy

Get an existing AlertPolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property combiner

public combiner: pulumi.Output<string>;

property conditions

public conditions: pulumi.Output<{
    conditionAbsent: {
        aggregations: {
            alignmentPeriod: string;
            crossSeriesReducer: string;
            groupByFields: string[];
            perSeriesAligner: string;
        }[];
        duration: string;
        filter: string;
        trigger: {
            count: number;
            percent: number;
        };
    };
    conditionThreshold: {
        aggregations: {
            alignmentPeriod: string;
            crossSeriesReducer: string;
            groupByFields: string[];
            perSeriesAligner: string;
        }[];
        comparison: string;
        denominatorAggregations: {
            alignmentPeriod: string;
            crossSeriesReducer: string;
            groupByFields: string[];
            perSeriesAligner: string;
        }[];
        denominatorFilter: string;
        duration: string;
        filter: string;
        thresholdValue: number;
        trigger: {
            count: number;
            percent: number;
        };
    };
    displayName: string;
    name: string;
}[]>;

property creationRecord

public creationRecord: pulumi.Output<{
    mutateTime: string;
    mutatedBy: string;
}>;

property displayName

public displayName: pulumi.Output<string>;

property documentation

public documentation: pulumi.Output<{
    content: string;
    mimeType: string;
} | undefined>;

property enabled

public enabled: pulumi.Output<boolean | undefined>;

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property labels

public labels: pulumi.Output<string[] | undefined>;

property name

public name: pulumi.Output<string>;

property notificationChannels

public notificationChannels: pulumi.Output<string[] | undefined>;

property project

public project: pulumi.Output<string>;

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class Group

extends CustomResource

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: "New Test Group",
    filter: "resource.metadata.region=\"europe-west2\"",
});

Example Usage - Monitoring Group Subgroup

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const parent = new gcp.monitoring.Group("parent", {
    displayName: "New Test SubGroup",
    filter: "resource.metadata.region=\"europe-west2\"",
});
const subgroup = new gcp.monitoring.Group("subgroup", {
    displayName: "New Test SubGroup",
    filter: "resource.metadata.region=\"europe-west2\"",
    parentName: parent.name,
});

constructor

new Group(name: string, args: GroupArgs, opts?: pulumi.CustomResourceOptions)

Create a Group resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: GroupState, opts?: pulumi.CustomResourceOptions): Group

Get an existing Group resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property displayName

public displayName: pulumi.Output<string>;

property filter

public filter: pulumi.Output<string>;

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property isCluster

public isCluster: pulumi.Output<boolean | undefined>;

property name

public name: pulumi.Output<string>;

property parentName

public parentName: pulumi.Output<string | undefined>;

property project

public project: pulumi.Output<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class NotificationChannel

extends CustomResource

A NotificationChannel is a medium through which an alert is delivered when a policy violation is detected. Examples of channels include email, SMS, and third-party messaging applications. Fields containing sensitive information like authentication tokens or contact info are only partially populated on retrieval.

To get more information about NotificationChannel, see:

Example Usage - Notification Channel Basic

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const basic = new gcp.monitoring.NotificationChannel("basic", {
    displayName: "Test Notification Channel",
    labels: {
        email_address: "fake_email@blahblah.com",
    },
    type: "email",
});

constructor

new NotificationChannel(name: string, args: NotificationChannelArgs, opts?: pulumi.CustomResourceOptions)

Create a NotificationChannel resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: NotificationChannelState, opts?: pulumi.CustomResourceOptions): NotificationChannel

Get an existing NotificationChannel resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property description

public description: pulumi.Output<string | undefined>;

property displayName

public displayName: pulumi.Output<string>;

property enabled

public enabled: pulumi.Output<boolean | undefined>;

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property labels

public labels: pulumi.Output<{[key: string]: string} | undefined>;

property name

public name: pulumi.Output<string>;

property project

public project: pulumi.Output<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

property type

public type: pulumi.Output<string>;

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

property userLabels

public userLabels: pulumi.Output<{[key: string]: string} | undefined>;

property verificationStatus

public verificationStatus: pulumi.Output<string>;

class UptimeCheckConfig

extends CustomResource

This message configures which resources and services to monitor for availability.

To get more information about UptimeCheckConfig, see:

Example Usage - Uptime Check Config Http

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const http = new gcp.monitoring.UptimeCheckConfig("http", {
    contentMatchers: [{
        content: "example",
    }],
    displayName: "http-uptime-check",
    httpCheck: {
        path: "/some-path",
        port: 8010,
    },
    monitoredResource: {
        labels: {
            host: "192.168.1.1",
            project_id: "example",
        },
        type: "uptime_url",
    },
    timeout: "60s",
});

Example Usage - Uptime Check Tcp

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const check = new gcp.monitoring.Group("check", {
    displayName: "uptime-check-group",
    filter: "resource.metadata.name=has_substring(\"foo\")",
});
const tcpGroup = new gcp.monitoring.UptimeCheckConfig("tcp_group", {
    displayName: "tcp-uptime-check",
    resourceGroup: {
        groupId: check.name,
        resourceType: "INSTANCE",
    },
    tcpCheck: {
        port: 888,
    },
    timeout: "60s",
});

constructor

new UptimeCheckConfig(name: string, args: UptimeCheckConfigArgs, opts?: pulumi.CustomResourceOptions)

Create a UptimeCheckConfig resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: UptimeCheckConfigState, opts?: pulumi.CustomResourceOptions): UptimeCheckConfig

Get an existing UptimeCheckConfig resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property contentMatchers

public contentMatchers: pulumi.Output<{
    content: string;
}[] | undefined>;

property displayName

public displayName: pulumi.Output<string>;

property httpCheck

public httpCheck: pulumi.Output<{
    authInfo: {
        password: string;
        username: string;
    };
    headers: {[key: string]: string};
    maskHeaders: boolean;
    path: string;
    port: number;
    useSsl: boolean;
} | undefined>;

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property internalCheckers

public internalCheckers: pulumi.Output<{
    displayName: string;
    gcpZone: string;
    name: string;
    network: string;
    peerProjectId: string;
}[] | undefined>;

property isInternal

public isInternal: pulumi.Output<boolean | undefined>;

property monitoredResource

public monitoredResource: pulumi.Output<{
    labels: {[key: string]: string};
    type: string;
} | undefined>;

property name

public name: pulumi.Output<string>;

property period

public period: pulumi.Output<string | undefined>;

property project

public project: pulumi.Output<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

property resourceGroup

public resourceGroup: pulumi.Output<{
    groupId: string;
    resourceType: string;
} | undefined>;

property selectedRegions

public selectedRegions: pulumi.Output<string[] | undefined>;

property tcpCheck

public tcpCheck: pulumi.Output<{
    port: number;
} | undefined>;

property timeout

public timeout: pulumi.Output<string>;

property uptimeCheckId

public uptimeCheckId: pulumi.Output<string>;

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

interface AlertPolicyArgs

The set of arguments for constructing a AlertPolicy resource.

property combiner

combiner: pulumi.Input<string>;

property conditions

conditions: pulumi.Input<pulumi.Input<{
    conditionAbsent: pulumi.Input<{
        aggregations: pulumi.Input<pulumi.Input<{
            alignmentPeriod: pulumi.Input<string>;
            crossSeriesReducer: pulumi.Input<string>;
            groupByFields: pulumi.Input<pulumi.Input<string>[]>;
            perSeriesAligner: pulumi.Input<string>;
        }>[]>;
        duration: pulumi.Input<string>;
        filter: pulumi.Input<string>;
        trigger: pulumi.Input<{
            count: pulumi.Input<number>;
            percent: pulumi.Input<number>;
        }>;
    }>;
    conditionThreshold: pulumi.Input<{
        aggregations: pulumi.Input<pulumi.Input<{
            alignmentPeriod: pulumi.Input<string>;
            crossSeriesReducer: pulumi.Input<string>;
            groupByFields: pulumi.Input<pulumi.Input<string>[]>;
            perSeriesAligner: pulumi.Input<string>;
        }>[]>;
        comparison: pulumi.Input<string>;
        denominatorAggregations: pulumi.Input<pulumi.Input<{
            alignmentPeriod: pulumi.Input<string>;
            crossSeriesReducer: pulumi.Input<string>;
            groupByFields: pulumi.Input<pulumi.Input<string>[]>;
            perSeriesAligner: pulumi.Input<string>;
        }>[]>;
        denominatorFilter: pulumi.Input<string>;
        duration: pulumi.Input<string>;
        filter: pulumi.Input<string>;
        thresholdValue: pulumi.Input<number>;
        trigger: pulumi.Input<{
            count: pulumi.Input<number>;
            percent: pulumi.Input<number>;
        }>;
    }>;
    displayName: pulumi.Input<string>;
    name: pulumi.Input<string>;
}>[]>;

property displayName

displayName: pulumi.Input<string>;

property documentation

documentation?: pulumi.Input<{
    content: pulumi.Input<string>;
    mimeType: pulumi.Input<string>;
}>;

property enabled

enabled?: pulumi.Input<boolean>;

property labels

property notificationChannels

notificationChannels?: pulumi.Input<pulumi.Input<string>[]>;

property project

project?: pulumi.Input<string>;

interface AlertPolicyState

Input properties used for looking up and filtering AlertPolicy resources.

property combiner

combiner?: pulumi.Input<string>;

property conditions

conditions?: pulumi.Input<pulumi.Input<{
    conditionAbsent: pulumi.Input<{
        aggregations: pulumi.Input<pulumi.Input<{
            alignmentPeriod: pulumi.Input<string>;
            crossSeriesReducer: pulumi.Input<string>;
            groupByFields: pulumi.Input<pulumi.Input<string>[]>;
            perSeriesAligner: pulumi.Input<string>;
        }>[]>;
        duration: pulumi.Input<string>;
        filter: pulumi.Input<string>;
        trigger: pulumi.Input<{
            count: pulumi.Input<number>;
            percent: pulumi.Input<number>;
        }>;
    }>;
    conditionThreshold: pulumi.Input<{
        aggregations: pulumi.Input<pulumi.Input<{
            alignmentPeriod: pulumi.Input<string>;
            crossSeriesReducer: pulumi.Input<string>;
            groupByFields: pulumi.Input<pulumi.Input<string>[]>;
            perSeriesAligner: pulumi.Input<string>;
        }>[]>;
        comparison: pulumi.Input<string>;
        denominatorAggregations: pulumi.Input<pulumi.Input<{
            alignmentPeriod: pulumi.Input<string>;
            crossSeriesReducer: pulumi.Input<string>;
            groupByFields: pulumi.Input<pulumi.Input<string>[]>;
            perSeriesAligner: pulumi.Input<string>;
        }>[]>;
        denominatorFilter: pulumi.Input<string>;
        duration: pulumi.Input<string>;
        filter: pulumi.Input<string>;
        thresholdValue: pulumi.Input<number>;
        trigger: pulumi.Input<{
            count: pulumi.Input<number>;
            percent: pulumi.Input<number>;
        }>;
    }>;
    displayName: pulumi.Input<string>;
    name: pulumi.Input<string>;
}>[]>;

property creationRecord

creationRecord?: pulumi.Input<{
    mutateTime: pulumi.Input<string>;
    mutatedBy: pulumi.Input<string>;
}>;

property displayName

displayName?: pulumi.Input<string>;

property documentation

documentation?: pulumi.Input<{
    content: pulumi.Input<string>;
    mimeType: pulumi.Input<string>;
}>;

property enabled

enabled?: pulumi.Input<boolean>;

property labels

property name

name?: pulumi.Input<string>;

property notificationChannels

notificationChannels?: pulumi.Input<pulumi.Input<string>[]>;

property project

project?: pulumi.Input<string>;

interface GroupArgs

The set of arguments for constructing a Group resource.

property displayName

displayName: pulumi.Input<string>;

property filter

filter: pulumi.Input<string>;

property isCluster

isCluster?: pulumi.Input<boolean>;

property parentName

parentName?: pulumi.Input<string>;

property project

project?: pulumi.Input<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

interface GroupState

Input properties used for looking up and filtering Group resources.

property displayName

displayName?: pulumi.Input<string>;

property filter

filter?: pulumi.Input<string>;

property isCluster

isCluster?: pulumi.Input<boolean>;

property name

name?: pulumi.Input<string>;

property parentName

parentName?: pulumi.Input<string>;

property project

project?: pulumi.Input<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

interface NotificationChannelArgs

The set of arguments for constructing a NotificationChannel resource.

property description

description?: pulumi.Input<string>;

property displayName

displayName: pulumi.Input<string>;

property enabled

enabled?: pulumi.Input<boolean>;

property labels

labels?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;

property project

project?: pulumi.Input<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

property type

property userLabels

userLabels?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;

interface NotificationChannelState

Input properties used for looking up and filtering NotificationChannel resources.

property description

description?: pulumi.Input<string>;

property displayName

displayName?: pulumi.Input<string>;

property enabled

enabled?: pulumi.Input<boolean>;

property labels

labels?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;

property name

name?: pulumi.Input<string>;

property project

project?: pulumi.Input<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

property type

type?: pulumi.Input<string>;

property userLabels

userLabels?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;

property verificationStatus

verificationStatus?: pulumi.Input<string>;

interface UptimeCheckConfigArgs

The set of arguments for constructing a UptimeCheckConfig resource.

property contentMatchers

contentMatchers?: pulumi.Input<pulumi.Input<{
    content: pulumi.Input<string>;
}>[]>;

property displayName

displayName: pulumi.Input<string>;

property httpCheck

httpCheck?: pulumi.Input<{
    authInfo: pulumi.Input<{
        password: pulumi.Input<string>;
        username: pulumi.Input<string>;
    }>;
    headers: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
    maskHeaders: pulumi.Input<boolean>;
    path: pulumi.Input<string>;
    port: pulumi.Input<number>;
    useSsl: pulumi.Input<boolean>;
}>;

property internalCheckers

internalCheckers?: pulumi.Input<pulumi.Input<{
    displayName: pulumi.Input<string>;
    gcpZone: pulumi.Input<string>;
    name: pulumi.Input<string>;
    network: pulumi.Input<string>;
    peerProjectId: pulumi.Input<string>;
}>[]>;

property isInternal

isInternal?: pulumi.Input<boolean>;

property monitoredResource

monitoredResource?: pulumi.Input<{
    labels: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
    type: pulumi.Input<string>;
}>;

property period

period?: pulumi.Input<string>;

property project

project?: pulumi.Input<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

property resourceGroup

resourceGroup?: pulumi.Input<{
    groupId: pulumi.Input<string>;
    resourceType: pulumi.Input<string>;
}>;

property selectedRegions

selectedRegions?: pulumi.Input<pulumi.Input<string>[]>;

property tcpCheck

tcpCheck?: pulumi.Input<{
    port: pulumi.Input<number>;
}>;

property timeout

timeout: pulumi.Input<string>;

interface UptimeCheckConfigState

Input properties used for looking up and filtering UptimeCheckConfig resources.

property contentMatchers

contentMatchers?: pulumi.Input<pulumi.Input<{
    content: pulumi.Input<string>;
}>[]>;

property displayName

displayName?: pulumi.Input<string>;

property httpCheck

httpCheck?: pulumi.Input<{
    authInfo: pulumi.Input<{
        password: pulumi.Input<string>;
        username: pulumi.Input<string>;
    }>;
    headers: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
    maskHeaders: pulumi.Input<boolean>;
    path: pulumi.Input<string>;
    port: pulumi.Input<number>;
    useSsl: pulumi.Input<boolean>;
}>;

property internalCheckers

internalCheckers?: pulumi.Input<pulumi.Input<{
    displayName: pulumi.Input<string>;
    gcpZone: pulumi.Input<string>;
    name: pulumi.Input<string>;
    network: pulumi.Input<string>;
    peerProjectId: pulumi.Input<string>;
}>[]>;

property isInternal

isInternal?: pulumi.Input<boolean>;

property monitoredResource

monitoredResource?: pulumi.Input<{
    labels: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
    type: pulumi.Input<string>;
}>;

property name

name?: pulumi.Input<string>;

property period

period?: pulumi.Input<string>;

property project

project?: pulumi.Input<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

property resourceGroup

resourceGroup?: pulumi.Input<{
    groupId: pulumi.Input<string>;
    resourceType: pulumi.Input<string>;
}>;

property selectedRegions

selectedRegions?: pulumi.Input<pulumi.Input<string>[]>;

property tcpCheck

tcpCheck?: pulumi.Input<{
    port: pulumi.Input<number>;
}>;

property timeout

timeout?: pulumi.Input<string>;

property uptimeCheckId

uptimeCheckId?: pulumi.Input<string>;