@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
103 lines • 3.93 kB
JavaScript
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.MonitoredProject = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* A [project being monitored](https://cloud.google.com/monitoring/settings/multiple-projects#create-multi) by a Metrics Scope.
*
* To get more information about MonitoredProject, see:
*
* * [API documentation](https://cloud.google.com/monitoring/api/ref_v3/rest/v1/locations.global.metricsScopes.projects)
* * How-to Guides
* * [Official Documentation](https://cloud.google.com/monitoring/settings/manage-api)
*
* ## Example Usage
*
* ### Monitoring Monitored Project Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const basic = new gcp.organizations.Project("basic", {
* projectId: "m-id",
* name: "m-id-display",
* orgId: "123456789",
* deletionPolicy: "DELETE",
* });
* const primary = new gcp.monitoring.MonitoredProject("primary", {
* metricsScope: "my-project-name",
* name: basic.projectId,
* });
* ```
*
* ## Import
*
* MonitoredProject can be imported using any of these accepted formats:
*
* * `v1/locations/global/metricsScopes/{{name}}`
*
* * `{{name}}`
*
* When using the `pulumi import` command, MonitoredProject can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:monitoring/monitoredProject:MonitoredProject default v1/locations/global/metricsScopes/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:monitoring/monitoredProject:MonitoredProject default {{name}}
* ```
*/
class MonitoredProject extends pulumi.CustomResource {
/**
* Get an existing MonitoredProject resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new MonitoredProject(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of MonitoredProject. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === MonitoredProject.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["createTime"] = state?.createTime;
resourceInputs["metricsScope"] = state?.metricsScope;
resourceInputs["name"] = state?.name;
}
else {
const args = argsOrState;
if (args?.metricsScope === undefined && !opts.urn) {
throw new Error("Missing required property 'metricsScope'");
}
resourceInputs["metricsScope"] = args?.metricsScope;
resourceInputs["name"] = args?.name;
resourceInputs["createTime"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(MonitoredProject.__pulumiType, name, resourceInputs, opts);
}
}
exports.MonitoredProject = MonitoredProject;
/** @internal */
MonitoredProject.__pulumiType = 'gcp:monitoring/monitoredProject:MonitoredProject';
//# sourceMappingURL=monitoredProject.js.map
;