UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

261 lines (260 loc) 9.77 kB
import * as pulumi from "@pulumi/pulumi"; import { input as inputs, output as outputs } from "../types"; /** * 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 * ``` */ export declare 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: string, id: pulumi.Input<pulumi.ID>, state?: NotificationState, opts?: pulumi.CustomResourceOptions): Notification; /** * 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: any): obj is Notification; /** * Specifies the cloud service agency name. The value can only be **cts_admin_trust**. */ readonly agencyName: pulumi.Output<string | undefined>; /** * The creation time of the notification. */ readonly createdAt: pulumi.Output<string>; /** * Specifies whether notification is enabled, defaults to true. */ readonly enabled: pulumi.Output<boolean | undefined>; /** * Specifies the filtering rules for notification. * The filter structure is documented below. */ readonly filter: pulumi.Output<outputs.Cts.NotificationFilter | undefined>; /** * Specifies the notification name. The value contains a maximum of `64` characters, * and only English letters, digits, underscores(_), and Chinese characters are allowed. */ readonly name: pulumi.Output<string>; /** * The notification ID in UUID format. */ readonly notificationId: pulumi.Output<string>; /** * Specifies the operation type, possible options include **complete** and * **customized**. */ readonly operationType: pulumi.Output<string>; /** * Specifies an array of users. Notifications will be sent when specified users * perform specified operations. All users are selected by default. * The operationUsers structure is documented below. */ readonly operationUsers: pulumi.Output<outputs.Cts.NotificationOperationUser[] | undefined>; /** * Specifies an array of operations that will trigger notifications. * For details, see [Supported Services and Operations](https://support.huaweicloud.com/intl/en-us/usermanual-cts/cts_03_0022.html). * The operations structure is documented below. */ readonly operations: pulumi.Output<outputs.Cts.NotificationOperation[] | undefined>; /** * Specifies the region in which to manage the CTS notification resource. * If omitted, the provider-level region will be used. Changing this creates a new resource. */ readonly region: pulumi.Output<string>; /** * Specifies the URN of a topic. */ readonly smnTopic: pulumi.Output<string | undefined>; /** * The notification status, the value can be **enabled** or **disabled**. */ readonly status: pulumi.Output<string>; /** * Create a Notification resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: NotificationArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Notification resources. */ export interface NotificationState { /** * Specifies the cloud service agency name. The value can only be **cts_admin_trust**. */ agencyName?: pulumi.Input<string>; /** * The creation time of the notification. */ createdAt?: pulumi.Input<string>; /** * Specifies whether notification is enabled, defaults to true. */ enabled?: pulumi.Input<boolean>; /** * Specifies the filtering rules for notification. * The filter structure is documented below. */ filter?: pulumi.Input<inputs.Cts.NotificationFilter>; /** * Specifies the notification name. The value contains a maximum of `64` characters, * and only English letters, digits, underscores(_), and Chinese characters are allowed. */ name?: pulumi.Input<string>; /** * The notification ID in UUID format. */ notificationId?: pulumi.Input<string>; /** * Specifies the operation type, possible options include **complete** and * **customized**. */ operationType?: pulumi.Input<string>; /** * Specifies an array of users. Notifications will be sent when specified users * perform specified operations. All users are selected by default. * The operationUsers structure is documented below. */ operationUsers?: pulumi.Input<pulumi.Input<inputs.Cts.NotificationOperationUser>[]>; /** * Specifies an array of operations that will trigger notifications. * For details, see [Supported Services and Operations](https://support.huaweicloud.com/intl/en-us/usermanual-cts/cts_03_0022.html). * The operations structure is documented below. */ operations?: pulumi.Input<pulumi.Input<inputs.Cts.NotificationOperation>[]>; /** * Specifies the region in which to manage the CTS notification resource. * If omitted, the provider-level region will be used. Changing this creates a new resource. */ region?: pulumi.Input<string>; /** * Specifies the URN of a topic. */ smnTopic?: pulumi.Input<string>; /** * The notification status, the value can be **enabled** or **disabled**. */ status?: pulumi.Input<string>; } /** * The set of arguments for constructing a Notification resource. */ export interface NotificationArgs { /** * Specifies the cloud service agency name. The value can only be **cts_admin_trust**. */ agencyName?: pulumi.Input<string>; /** * Specifies whether notification is enabled, defaults to true. */ enabled?: pulumi.Input<boolean>; /** * Specifies the filtering rules for notification. * The filter structure is documented below. */ filter?: pulumi.Input<inputs.Cts.NotificationFilter>; /** * Specifies the notification name. The value contains a maximum of `64` characters, * and only English letters, digits, underscores(_), and Chinese characters are allowed. */ name?: pulumi.Input<string>; /** * Specifies the operation type, possible options include **complete** and * **customized**. */ operationType: pulumi.Input<string>; /** * Specifies an array of users. Notifications will be sent when specified users * perform specified operations. All users are selected by default. * The operationUsers structure is documented below. */ operationUsers?: pulumi.Input<pulumi.Input<inputs.Cts.NotificationOperationUser>[]>; /** * Specifies an array of operations that will trigger notifications. * For details, see [Supported Services and Operations](https://support.huaweicloud.com/intl/en-us/usermanual-cts/cts_03_0022.html). * The operations structure is documented below. */ operations?: pulumi.Input<pulumi.Input<inputs.Cts.NotificationOperation>[]>; /** * Specifies the region in which to manage the CTS notification resource. * If omitted, the provider-level region will be used. Changing this creates a new resource. */ region?: pulumi.Input<string>; /** * Specifies the URN of a topic. */ smnTopic?: pulumi.Input<string>; }