@volcengine/pulumi
Version:
A Pulumi package for creating and managing volcengine cloud resources.
113 lines • 4.76 kB
JavaScript
;
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.SilencePolicy = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a resource to manage vmp silence policy
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as volcengine from "@volcengine/pulumi";
*
* const example = new volcengine.vmp.SilencePolicy("example", {
* description: "terraform silence policy",
* metricLabelMatchers: [{
* matchers: [
* {
* label: "app",
* operator: "NotEqual",
* value: "test",
* },
* {
* label: "env",
* operator: "Equal",
* value: "prod",
* },
* ],
* }],
* timeRangeMatchers: [{
* location: "Asia/Shanghai",
* periodicDate: {
* time: "20:00~21:12",
* weekday: "1,5",
* },
* }],
* });
* ```
*
* ## Import
*
* VmpSilencePolicy can be imported using the id, e.g.
*
* ```sh
* $ pulumi import volcengine:vmp/silencePolicy:SilencePolicy default resource_id
* ```
*/
class SilencePolicy extends pulumi.CustomResource {
/**
* Get an existing SilencePolicy 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 SilencePolicy(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of SilencePolicy. 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'] === SilencePolicy.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["autoDeleteTime"] = state ? state.autoDeleteTime : undefined;
resourceInputs["createTime"] = state ? state.createTime : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["metricLabelMatchers"] = state ? state.metricLabelMatchers : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["source"] = state ? state.source : undefined;
resourceInputs["status"] = state ? state.status : undefined;
resourceInputs["timeRangeMatchers"] = state ? state.timeRangeMatchers : undefined;
resourceInputs["updateTime"] = state ? state.updateTime : undefined;
}
else {
const args = argsOrState;
if ((!args || args.metricLabelMatchers === undefined) && !opts.urn) {
throw new Error("Missing required property 'metricLabelMatchers'");
}
if ((!args || args.timeRangeMatchers === undefined) && !opts.urn) {
throw new Error("Missing required property 'timeRangeMatchers'");
}
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["metricLabelMatchers"] = args ? args.metricLabelMatchers : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["timeRangeMatchers"] = args ? args.timeRangeMatchers : undefined;
resourceInputs["autoDeleteTime"] = undefined /*out*/;
resourceInputs["createTime"] = undefined /*out*/;
resourceInputs["source"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
resourceInputs["updateTime"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(SilencePolicy.__pulumiType, name, resourceInputs, opts);
}
}
exports.SilencePolicy = SilencePolicy;
/** @internal */
SilencePolicy.__pulumiType = 'volcengine:vmp/silencePolicy:SilencePolicy';
//# sourceMappingURL=silencePolicy.js.map