UNPKG

@pulumiverse/grafana

Version:

A Pulumi package for creating and managing grafana.

165 lines (164 loc) 6.85 kB
import * as pulumi from "@pulumi/pulumi"; /** * * [HTTP API](https://grafana.com/docs/oncall/latest/oncall-api-reference/personal_notification_rules/) * * **Note**: you must be running Grafana OnCall >= v1.8.0 to use this resource. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as grafana from "@pulumiverse/grafana"; * * const myUser = grafana.onCall.getUser({ * username: "my_username", * }); * const myUserStep1 = new grafana.oncall.UserNotificationRule("my_user_step_1", { * userId: myUser.then(myUser => myUser.id), * position: 0, * type: "notify_by_mobile_app", * }); * const myUserStep2 = new grafana.oncall.UserNotificationRule("my_user_step_2", { * userId: myUser.then(myUser => myUser.id), * position: 1, * duration: 600, * type: "wait", * }); * const myUserStep3 = new grafana.oncall.UserNotificationRule("my_user_step_3", { * userId: myUser.then(myUser => myUser.id), * position: 2, * type: "notify_by_phone_call", * }); * const myUserStep4 = new grafana.oncall.UserNotificationRule("my_user_step_4", { * userId: myUser.then(myUser => myUser.id), * position: 3, * duration: 300, * type: "wait", * }); * const myUserStep5 = new grafana.oncall.UserNotificationRule("my_user_step_5", { * userId: myUser.then(myUser => myUser.id), * position: 4, * type: "notify_by_slack", * }); * const myUserImportantStep1 = new grafana.oncall.UserNotificationRule("my_user_important_step_1", { * userId: myUser.then(myUser => myUser.id), * important: true, * position: 0, * type: "notify_by_mobile_app_critical", * }); * const myUserImportantStep2 = new grafana.oncall.UserNotificationRule("my_user_important_step_2", { * userId: myUser.then(myUser => myUser.id), * important: true, * position: 1, * duration: 300, * type: "wait", * }); * const myUserImportantStep3 = new grafana.oncall.UserNotificationRule("my_user_important_step_3", { * userId: myUser.then(myUser => myUser.id), * important: true, * position: 2, * type: "notify_by_mobile_app_critical", * }); * ``` * * ## Import * * ```sh * terraform import grafana_oncall_user_notification_rule.name "{{ id }}" * ``` */ export declare class UserNotificationRule extends pulumi.CustomResource { /** * Get an existing UserNotificationRule 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?: UserNotificationRuleState, opts?: pulumi.CustomResourceOptions): UserNotificationRule; /** * Returns true if the given object is an instance of UserNotificationRule. 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 UserNotificationRule; /** * A time in seconds to wait (when `type=wait`). Can be 60, 300, 900, 1800, 3600 */ readonly duration: pulumi.Output<number | undefined>; /** * Boolean value which indicates if a rule is “important” */ readonly important: pulumi.Output<boolean>; /** * Personal notification rules execute one after another starting from position=0. A new escalation policy created with a position of an existing escalation policy will move the old one (and all following) down on the list. */ readonly position: pulumi.Output<number | undefined>; /** * The type of notification rule. Can be wait, notify*by*slack, notify*by*msteams, notify*by*sms, notify*by*phone*call, notify*by*telegram, notify*by*email, notify*by*mobile*app, notify*by*mobile*app*critical. NOTE: `notifyByMsteams` is only available for Grafana Cloud customers. */ readonly type: pulumi.Output<string>; /** * User ID */ readonly userId: pulumi.Output<string>; /** * Create a UserNotificationRule 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: UserNotificationRuleArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering UserNotificationRule resources. */ export interface UserNotificationRuleState { /** * A time in seconds to wait (when `type=wait`). Can be 60, 300, 900, 1800, 3600 */ duration?: pulumi.Input<number>; /** * Boolean value which indicates if a rule is “important” */ important?: pulumi.Input<boolean>; /** * Personal notification rules execute one after another starting from position=0. A new escalation policy created with a position of an existing escalation policy will move the old one (and all following) down on the list. */ position?: pulumi.Input<number>; /** * The type of notification rule. Can be wait, notify*by*slack, notify*by*msteams, notify*by*sms, notify*by*phone*call, notify*by*telegram, notify*by*email, notify*by*mobile*app, notify*by*mobile*app*critical. NOTE: `notifyByMsteams` is only available for Grafana Cloud customers. */ type?: pulumi.Input<string>; /** * User ID */ userId?: pulumi.Input<string>; } /** * The set of arguments for constructing a UserNotificationRule resource. */ export interface UserNotificationRuleArgs { /** * A time in seconds to wait (when `type=wait`). Can be 60, 300, 900, 1800, 3600 */ duration?: pulumi.Input<number>; /** * Boolean value which indicates if a rule is “important” */ important?: pulumi.Input<boolean>; /** * Personal notification rules execute one after another starting from position=0. A new escalation policy created with a position of an existing escalation policy will move the old one (and all following) down on the list. */ position?: pulumi.Input<number>; /** * The type of notification rule. Can be wait, notify*by*slack, notify*by*msteams, notify*by*sms, notify*by*phone*call, notify*by*telegram, notify*by*email, notify*by*mobile*app, notify*by*mobile*app*critical. NOTE: `notifyByMsteams` is only available for Grafana Cloud customers. */ type: pulumi.Input<string>; /** * User ID */ userId: pulumi.Input<string>; }