import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * A [slack connection](https://developer.pagerduty.com/api-reference/YXBpOjExMjA5NTQ0-pager-duty-slack-integration-api) allows you to connect a workspace in Slack to a PagerDuty service or team which allows you to acknowledge and resolve PagerDuty incidents from the Slack user interface. * * **NOTES for using this resource:** * * To first use this resource you will need to [map your PagerDuty account to a valid Slack Workspace](https://support.pagerduty.com/docs/slack-integration-guide#integration-walkthrough). *This can only be done through the PagerDuty UI.* * * This resource requires a PagerDuty [user-level API key](https://support.pagerduty.com/docs/generating-api-keys#section-generating-a-personal-rest-api-key). This can be set as the `userToken` on the provider tag or as the `PAGERDUTY_USER_TOKEN` environment variable. * * This resource is for configuring Slack V2 Next Generation connections. If you configured your Slack integration (V1 or V2) prior to August 10, 2021, you may migrate to the Slack V2 Next Generation update using this [migration instructions](https://support.pagerduty.com/docs/slack-integration-guide#migrate-to-slack-v2-next-generation), but if you configured your Slack integration after that date, you will have access to the update out of the box. * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pagerduty from "@pulumi/pagerduty"; * * const foo = new pagerduty.Team("foo", {name: "Team Foo"}); * const p1 = pagerduty.getPriority({ * name: "P1", * }); * const fooSlackConnection = new pagerduty.SlackConnection("foo", { * sourceId: foo.id, * sourceType: "team_reference", * workspaceId: "T02A123LV1A", * channelId: "C02CABCDAC9", * notificationType: "responder", * configs: [{ * events: [ * "incident.triggered", * "incident.acknowledged", * "incident.escalated", * "incident.resolved", * "incident.reassigned", * "incident.annotated", * "incident.unacknowledged", * "incident.delegated", * "incident.priority_updated", * "incident.responder.added", * "incident.responder.replied", * "incident.status_update_published", * "incident.reopened", * ], * priorities: [p1.then(p1 => p1.id)], * }], * }); * ``` * * ## Import * * Slack connections can be imported using the related `workspace` ID and the `slackConnection` ID separated by a dot, e.g. * * ```sh * $ pulumi import pagerduty:index/slackConnection:SlackConnection main T02A123LV1A.PUABCDL * ``` */ export declare class SlackConnection extends pulumi.CustomResource { /** * Get an existing SlackConnection 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, state?: SlackConnectionState, opts?: pulumi.CustomResourceOptions): SlackConnection; /** * Returns true if the given object is an instance of SlackConnection. 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 SlackConnection; /** * The ID of a Slack channel in the workspace. */ readonly channelId: pulumi.Output; /** * Name of the Slack channel in Slack connection. */ readonly channelName: pulumi.Output; /** * Configuration options for the Slack connection that provide options to filter events. */ readonly configs: pulumi.Output; /** * Type of notification. Either `responder` or `stakeholder`. */ readonly notificationType: pulumi.Output; /** * The ID of the source in PagerDuty. Valid sources are services or teams. */ readonly sourceId: pulumi.Output; /** * Name of the source (team or service) in Slack connection. */ readonly sourceName: pulumi.Output; /** * The type of the source. Either `teamReference` or `serviceReference`. */ readonly sourceType: pulumi.Output; /** * The slack team (workspace) ID of the connected Slack workspace. Can also be defined by the `SLACK_CONNECTION_WORKSPACE_ID` environment variable. */ readonly workspaceId: pulumi.Output; /** * Create a SlackConnection 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: SlackConnectionArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering SlackConnection resources. */ export interface SlackConnectionState { /** * The ID of a Slack channel in the workspace. */ channelId?: pulumi.Input; /** * Name of the Slack channel in Slack connection. */ channelName?: pulumi.Input; /** * Configuration options for the Slack connection that provide options to filter events. */ configs?: pulumi.Input[]>; /** * Type of notification. Either `responder` or `stakeholder`. */ notificationType?: pulumi.Input; /** * The ID of the source in PagerDuty. Valid sources are services or teams. */ sourceId?: pulumi.Input; /** * Name of the source (team or service) in Slack connection. */ sourceName?: pulumi.Input; /** * The type of the source. Either `teamReference` or `serviceReference`. */ sourceType?: pulumi.Input; /** * The slack team (workspace) ID of the connected Slack workspace. Can also be defined by the `SLACK_CONNECTION_WORKSPACE_ID` environment variable. */ workspaceId?: pulumi.Input; } /** * The set of arguments for constructing a SlackConnection resource. */ export interface SlackConnectionArgs { /** * The ID of a Slack channel in the workspace. */ channelId: pulumi.Input; /** * Configuration options for the Slack connection that provide options to filter events. */ configs: pulumi.Input[]>; /** * Type of notification. Either `responder` or `stakeholder`. */ notificationType: pulumi.Input; /** * The ID of the source in PagerDuty. Valid sources are services or teams. */ sourceId: pulumi.Input; /** * The type of the source. Either `teamReference` or `serviceReference`. */ sourceType: pulumi.Input; /** * The slack team (workspace) ID of the connected Slack workspace. Can also be defined by the `SLACK_CONNECTION_WORKSPACE_ID` environment variable. */ workspaceId?: pulumi.Input; }