@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
141 lines • 5.74 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.Notification = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages CTS key event notification resource within HuaweiCloud.
*
* ## Example Usage
* ### Complete Notification
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const topicUrn = config.requireObject("topicUrn");
* const notify = new huaweicloud.cts.Notification("notify", {
* operationType: "complete",
* smnTopic: topicUrn,
* });
* ```
* ### Complete Notification and Enable Filtering
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const topicUrn = config.requireObject("topicUrn");
* const notify = new huaweicloud.cts.Notification("notify", {
* operationType: "complete",
* smnTopic: topicUrn,
* filter: {
* condition: "AND",
* rules: [
* "code = 200",
* "resource_name = test",
* ],
* },
* });
* ```
* ### Customized Notification
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const topicUrn = config.requireObject("topicUrn");
* const notify = new huaweicloud.cts.Notification("notify", {
* operationType: "customized",
* smnTopic: topicUrn,
* operations: [{
* service: "ECS",
* resource: "ecs",
* traceNames: [
* "createServer",
* "deleteServer",
* ],
* }],
* });
* ```
*
* ## Import
*
* CTS notifications can be imported using `name`, e.g.bash
*
* ```sh
* $ pulumi import huaweicloud:Cts/notification:Notification tracker your_notification
* ```
*/
class Notification extends pulumi.CustomResource {
/**
* Get an existing Notification 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 Notification(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Notification. 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'] === Notification.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["agencyName"] = state ? state.agencyName : undefined;
resourceInputs["createdAt"] = state ? state.createdAt : undefined;
resourceInputs["enabled"] = state ? state.enabled : undefined;
resourceInputs["filter"] = state ? state.filter : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["notificationId"] = state ? state.notificationId : undefined;
resourceInputs["operationType"] = state ? state.operationType : undefined;
resourceInputs["operationUsers"] = state ? state.operationUsers : undefined;
resourceInputs["operations"] = state ? state.operations : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["smnTopic"] = state ? state.smnTopic : undefined;
resourceInputs["status"] = state ? state.status : undefined;
}
else {
const args = argsOrState;
if ((!args || args.operationType === undefined) && !opts.urn) {
throw new Error("Missing required property 'operationType'");
}
resourceInputs["agencyName"] = args ? args.agencyName : undefined;
resourceInputs["enabled"] = args ? args.enabled : undefined;
resourceInputs["filter"] = args ? args.filter : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["operationType"] = args ? args.operationType : undefined;
resourceInputs["operationUsers"] = args ? args.operationUsers : undefined;
resourceInputs["operations"] = args ? args.operations : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["smnTopic"] = args ? args.smnTopic : undefined;
resourceInputs["createdAt"] = undefined /*out*/;
resourceInputs["notificationId"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Notification.__pulumiType, name, resourceInputs, opts);
}
}
exports.Notification = Notification;
/** @internal */
Notification.__pulumiType = 'huaweicloud:Cts/notification:Notification';
//# sourceMappingURL=notification.js.map