UNPKG

@pulumi/pagerduty

Version:

A Pulumi package for creating and managing pagerduty cloud resources.

82 lines 3.32 kB
"use strict"; // *** 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.getUserContactMethodOutput = exports.getUserContactMethod = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Use this data source to get information about a specific [contact method](https://developer.pagerduty.com/api-reference/b3A6Mjc0ODIzOQ-list-a-user-s-contact-methods) of a PagerDuty [user](https://developer.pagerduty.com/api-reference/b3A6Mjc0ODIzMw-list-users) that you can use for other PagerDuty resources. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pagerduty from "@pulumi/pagerduty"; * * const me = pagerduty.getUser({ * email: "me@example.com", * }); * const phonePush = me.then(me => pagerduty.getUserContactMethod({ * userId: me.id, * type: "push_notification_contact_method", * label: "iPhone (John)", * })); * const lowUrgencySms = new pagerduty.UserNotificationRule("low_urgency_sms", { * userId: me.then(me => me.id), * startDelayInMinutes: 5, * urgency: "high", * contactMethod: { * type: "push_notification_contact_method", * id: phonePush.then(phonePush => phonePush.id), * }, * }); * ``` */ function getUserContactMethod(args, opts) { opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invoke("pagerduty:index/getUserContactMethod:getUserContactMethod", { "label": args.label, "type": args.type, "userId": args.userId, }, opts); } exports.getUserContactMethod = getUserContactMethod; /** * Use this data source to get information about a specific [contact method](https://developer.pagerduty.com/api-reference/b3A6Mjc0ODIzOQ-list-a-user-s-contact-methods) of a PagerDuty [user](https://developer.pagerduty.com/api-reference/b3A6Mjc0ODIzMw-list-users) that you can use for other PagerDuty resources. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pagerduty from "@pulumi/pagerduty"; * * const me = pagerduty.getUser({ * email: "me@example.com", * }); * const phonePush = me.then(me => pagerduty.getUserContactMethod({ * userId: me.id, * type: "push_notification_contact_method", * label: "iPhone (John)", * })); * const lowUrgencySms = new pagerduty.UserNotificationRule("low_urgency_sms", { * userId: me.then(me => me.id), * startDelayInMinutes: 5, * urgency: "high", * contactMethod: { * type: "push_notification_contact_method", * id: phonePush.then(phonePush => phonePush.id), * }, * }); * ``` */ function getUserContactMethodOutput(args, opts) { opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invokeOutput("pagerduty:index/getUserContactMethod:getUserContactMethod", { "label": args.label, "type": args.type, "userId": args.userId, }, opts); } exports.getUserContactMethodOutput = getUserContactMethodOutput; //# sourceMappingURL=getUserContactMethod.js.map