@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
118 lines • 4.43 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.CustomService = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* A Service is a discrete, autonomous, and network-accessible unit,
* designed to solve an individual concern. In Cloud Monitoring,
* a Service acts as the root resource under which operational aspects of
* the service are accessible
*
* To get more information about Service, see:
*
* * [API documentation](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services)
* * How-to Guides
* * [Monitoring API Documentation](https://cloud.google.com/monitoring/api/v3/)
* * [Service Monitoring](https://cloud.google.com/monitoring/service-monitoring)
* * [Service-orientation on Wikipedia](https://en.wikipedia.org/wiki/Service-orientation)
*
* ## Example Usage
*
* ### Monitoring Service Custom
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const custom = new gcp.monitoring.CustomService("custom", {
* serviceId: "custom-srv",
* displayName: "My Custom Service custom-srv",
* telemetry: {
* resourceName: "//product.googleapis.com/foo/foo/services/test",
* },
* userLabels: {
* my_key: "my_value",
* my_other_key: "my_other_value",
* },
* });
* ```
*
* ## Import
*
* Service can be imported using any of these accepted formats:
*
* * `{{project}}/{{name}}`
*
* * `{{project}} {{name}}`
*
* * `{{name}}`
*
* When using the `pulumi import` command, Service can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:monitoring/customService:CustomService default {{project}}/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:monitoring/customService:CustomService default "{{project}} {{name}}"
* ```
*
* ```sh
* $ pulumi import gcp:monitoring/customService:CustomService default {{name}}
* ```
*/
class CustomService extends pulumi.CustomResource {
/**
* Get an existing CustomService 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 CustomService(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of CustomService. 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'] === CustomService.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["displayName"] = state?.displayName;
resourceInputs["name"] = state?.name;
resourceInputs["project"] = state?.project;
resourceInputs["serviceId"] = state?.serviceId;
resourceInputs["telemetry"] = state?.telemetry;
resourceInputs["userLabels"] = state?.userLabels;
}
else {
const args = argsOrState;
resourceInputs["displayName"] = args?.displayName;
resourceInputs["project"] = args?.project;
resourceInputs["serviceId"] = args?.serviceId;
resourceInputs["telemetry"] = args?.telemetry;
resourceInputs["userLabels"] = args?.userLabels;
resourceInputs["name"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(CustomService.__pulumiType, name, resourceInputs, opts);
}
}
exports.CustomService = CustomService;
/** @internal */
CustomService.__pulumiType = 'gcp:monitoring/customService:CustomService';
//# sourceMappingURL=customService.js.map
;