@volcengine/pulumi
Version:
A Pulumi package for creating and managing volcengine cloud resources.
135 lines • 6.48 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.AlarmContentTemplate = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a resource to manage tls alarm content template
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as volcengine from "@volcengine/pulumi";
*
* const foo = new volcengine.tls.AlarmContentTemplate("foo", {
* alarmContentTemplateName: "test-alarm-content-template",
* dingTalks: [{
* content: `修改-尊敬的用户,您好!
* 您的账号(主账户ID:{{AccountID}} )的日志服务{%if NotifyType==1%}触发告警{%else%}告警恢复{%endif%}
* 告警策略:{{Alarm}}
* 告警日志主题:{{AlarmTopicName}}
* 触发时间:{{StartTime}}
* 触发条件:{{Condition}}
* 当前查询结果:[{%-for x in TriggerParams-%}{{-x-}} {%-endfor-%}]
* 通知内容:{{NotifyMsg|escapejs}}
* 日志检索详情:[查看详情]({{QueryUrl}})
* 告警详情:[查看详情]({{SignInUrl}})
*
* 感谢对火山引擎的支持
* `,
* locale: "zh-CN",
* title: "修改-告警通知",
* }],
* emails: [{
* content: "修改-告警策略:{{Alarm}}<br> 告警日志项目:{{ProjectName}}<br>",
* locale: "zh-CN",
* subject: "修改-告警通知",
* }],
* larks: [{
* content: `修改-尊敬的用户,您好!
* 您的账号(主账户ID:{{AccountID}} )的日志服务{%if NotifyType==1%}触发告警{%else%}告警恢复{%endif%}
* 告警策略:{{Alarm}}
* 告警日志主题:{{AlarmTopicName}}
* 触发时间:{{StartTime}}
* 触发条件:{{Condition}}
* 当前查询结果:[{%-for x in TriggerParams-%}{{-x-}} {%-endfor-%}]
* 通知内容:{{NotifyMsg|escapejs}}
* 日志检索详情:[查看详情]({{QueryUrl}})
* 告警详情:[查看详情]({{SignInUrl}})
*
* 感谢对火山引擎的支持
* `,
* locale: "zh-CN",
* title: "修改-告警通知",
* }],
* needValidContent: true,
* sms: [{
* content: "修改-告警策略{{Alarm}}, 告警日志项目:{{ProjectName}}, 告警日志主题:{{AlarmTopicName}}, 告警级别:{{Severity}}, 通知类型:{%if NotifyType==1%}触发告警{%else%}告警恢复{%endif%},触发时间:{{StartTime}}, 触发条件:{{Condition}}, 当前查询结果:[{%-for x in TriggerParams-%}{{-x-}} {%-endfor-%}], 通知内容:{{NotifyMsg}}",
* locale: "zh-CN",
* }],
* });
* ```
*
* ## Import
*
* tls alarm content template can be imported using the alarm_content_template_id, e.g.
*
* ```sh
* $ pulumi import volcengine:tls/alarmContentTemplate:AlarmContentTemplate default alarm-content-template-123456
* ```
*/
class AlarmContentTemplate extends pulumi.CustomResource {
/**
* Get an existing AlarmContentTemplate 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 AlarmContentTemplate(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of AlarmContentTemplate. 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'] === AlarmContentTemplate.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["alarmContentTemplateId"] = state ? state.alarmContentTemplateId : undefined;
resourceInputs["alarmContentTemplateName"] = state ? state.alarmContentTemplateName : undefined;
resourceInputs["dingTalks"] = state ? state.dingTalks : undefined;
resourceInputs["emails"] = state ? state.emails : undefined;
resourceInputs["larks"] = state ? state.larks : undefined;
resourceInputs["needValidContent"] = state ? state.needValidContent : undefined;
resourceInputs["sms"] = state ? state.sms : undefined;
resourceInputs["vms"] = state ? state.vms : undefined;
resourceInputs["webhooks"] = state ? state.webhooks : undefined;
resourceInputs["wechats"] = state ? state.wechats : undefined;
}
else {
const args = argsOrState;
if ((!args || args.alarmContentTemplateName === undefined) && !opts.urn) {
throw new Error("Missing required property 'alarmContentTemplateName'");
}
resourceInputs["alarmContentTemplateName"] = args ? args.alarmContentTemplateName : undefined;
resourceInputs["dingTalks"] = args ? args.dingTalks : undefined;
resourceInputs["emails"] = args ? args.emails : undefined;
resourceInputs["larks"] = args ? args.larks : undefined;
resourceInputs["needValidContent"] = args ? args.needValidContent : undefined;
resourceInputs["sms"] = args ? args.sms : undefined;
resourceInputs["vms"] = args ? args.vms : undefined;
resourceInputs["webhooks"] = args ? args.webhooks : undefined;
resourceInputs["wechats"] = args ? args.wechats : undefined;
resourceInputs["alarmContentTemplateId"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(AlarmContentTemplate.__pulumiType, name, resourceInputs, opts);
}
}
exports.AlarmContentTemplate = AlarmContentTemplate;
/** @internal */
AlarmContentTemplate.__pulumiType = 'volcengine:tls/alarmContentTemplate:AlarmContentTemplate';
//# sourceMappingURL=alarmContentTemplate.js.map