import * as pulumi from "@pulumi/pulumi";
import * as inputs from "./types/input";
import * as outputs from "./types/output";
/**
* Use this resource to create and manage New Relic notification destinations. Details regarding supported products and permissions can be found [here](https://docs.newrelic.com/docs/alerts-applied-intelligence/notifications/destinations).
*
* ## Example Usage
*
* ##### [Webhook](https://docs.newrelic.com/docs/alerts-applied-intelligence/notifications/notification-integrations/#webhook)
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as newrelic from "@pulumi/newrelic";
*
* const foo = new newrelic.NotificationDestination("foo", {
* accountId: "12345678",
* name: "foo",
* type: "WEBHOOK",
* secureUrl: {
* prefix: "https://webhook.mywebhook.com/",
* secureSuffix: "service_id/123456",
* },
* properties: [{
* key: "source",
* value: "terraform",
* }],
* authCustomHeaders: [{
* key: "API_KEY",
* value: "test-api-key",
* }],
* });
* ```
* See additional examples.
*
* ## Additional Examples
*
* > **NOTE:** We support all properties. The mentioned properties are just an example.
*
* #### WORKFLOW_AUTOMATION
*
* > **NOTE:** For `WORKFLOW_AUTOMATION` destinations, all authentication is handled through `authCustomHeader` — no property values are needed. The `property` block must still be included because the provider requires it for all destination types; use empty strings for both `key` and `value` as shown.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as newrelic from "@pulumi/newrelic";
*
* const foo = new newrelic.NotificationDestination("foo", {
* accountId: "12345678",
* name: "workflow-automation-destination-name",
* type: "WORKFLOW_AUTOMATION",
* properties: [{
* key: "",
* value: "",
* }],
* authCustomHeaders: [{
* key: "Api-Key",
* value: "YOUR_NR_USER_API_KEY",
* }],
* });
* ```
*
* ##### [MICROSOFT_TEAMS](https://docs.newrelic.com/docs/alerts/get-notified/microsoft-teams-integrations/)
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as newrelic from "@pulumi/newrelic";
*
* const foo = new newrelic.NotificationDestination("foo", {
* accountId: "12345678",
* name: "ms-teams-example",
* type: "MICROSOFT_TEAMS",
* properties: [{
* key: "securityCode",
* value: "abcdefgh",
* }],
* });
* ```
*
* ##### [ServiceNow](https://docs.newrelic.com/docs/alerts-applied-intelligence/notifications/notification-integrations/#servicenow)
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as newrelic from "@pulumi/newrelic";
*
* const foo = new newrelic.NotificationDestination("foo", {
* accountId: "12345678",
* name: "servicenow-example",
* type: "SERVICE_NOW",
* properties: [
* {
* key: "url",
* value: "https://service-now.com/",
* },
* {
* key: "two_way_integration",
* value: "true",
* },
* ],
* authBasic: {
* user: "username",
* password: "password",
* },
* });
* ```
*
* ##### [Email](https://docs.newrelic.com/docs/alerts-applied-intelligence/notifications/notification-integrations/#email)
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as newrelic from "@pulumi/newrelic";
*
* const foo = new newrelic.NotificationDestination("foo", {
* accountId: "12345678",
* name: "email-example",
* type: "EMAIL",
* properties: [{
* key: "email",
* value: "email@email.com,email2@email.com",
* }],
* });
* ```
*
* ##### [Jira](https://docs.newrelic.com/docs/alerts-applied-intelligence/notifications/notification-integrations/#jira)
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as newrelic from "@pulumi/newrelic";
*
* const foo = new newrelic.NotificationDestination("foo", {
* accountId: "12345678",
* name: "jira-example",
* type: "JIRA",
* properties: [{
* key: "url",
* value: "https://example.atlassian.net",
* }],
* authBasic: {
* user: "example@email.com",
* password: "password",
* },
* });
* ```
*
* ##### [PagerDuty with service integration](https://docs.newrelic.com/docs/alerts-applied-intelligence/notifications/notification-integrations/#pagerduty-sli)
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as newrelic from "@pulumi/newrelic";
*
* const foo = new newrelic.NotificationDestination("foo", {
* accountId: "12345678",
* name: "pagerduty-service-example",
* type: "PAGERDUTY_SERVICE_INTEGRATION",
* properties: [{
* key: "",
* value: "",
* }],
* authToken: {
* prefix: "Token token=",
* token: "10567a689d984d03c021034b22a789e2",
* },
* });
* ```
*
* ##### [PagerDuty with account integration](https://docs.newrelic.com/docs/alerts-applied-intelligence/notifications/notification-integrations/#pagerduty-ali)
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as newrelic from "@pulumi/newrelic";
*
* const foo = new newrelic.NotificationDestination("foo", {
* accountId: "12345678",
* name: "pagerduty-account-example",
* type: "PAGERDUTY_ACCOUNT_INTEGRATION",
* properties: [{
* key: "two_way_integration",
* value: "true",
* }],
* authToken: {
* prefix: "Token token=",
* token: "u+E8EU3MhsZwLfZ1ic1A",
* },
* });
* ```
*
* #### Mobile Push
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as newrelic from "@pulumi/newrelic";
*
* const foo = new newrelic.NotificationDestination("foo", {
* accountId: "12345678",
* name: "mobile-push-example",
* type: "MOBILE_PUSH",
* properties: [{
* key: "userId",
* value: "12345678",
* }],
* });
* ```
*
* #### [AWS Event Bridge](https://docs.newrelic.com/docs/alerts-applied-intelligence/notifications/notification-integrations/#eventBridge)
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as newrelic from "@pulumi/newrelic";
*
* const foo = new newrelic.NotificationDestination("foo", {
* accountId: "12345678",
* name: "event-bridge-example",
* type: "EVENT_BRIDGE",
* properties: [
* {
* key: "AWSAccountId",
* value: "123456789123456",
* },
* {
* key: "AWSRegion",
* value: "us-east-2",
* },
* ],
* });
* ```
*
* #### [Slack](https://docs.newrelic.com/docs/alerts-applied-intelligence/notifications/notification-integrations/#slack)
*
* In order to create a Slack destination, you have to grant our application access to your workspace. This process is [based on OAuth](https://api.slack.com/authentication/oauth-v2) and can only be done through a browser.
* As a result, you cannot set up a Slack destination purely with Terraform code.
* However, if you would like to use Slack-based destinations with other resources in the New Relic Terraform Provider, the data source `newrelic.NotificationDestination` may be used to fetch the ID of the destination; alternatively, you might want to source the ID of the destination from NerdGraph, or from the New Relic One UI.
*
* ## Import
*
* > **WARNING:** Slack-based destinations can only be imported and destroyed; this resource **does not** support creating and updating Slack-based destinations, owing to the reasons stated above, under the **Slack** section.
*
* Destination id can be found in the Destinations page > three dots at the right of the chosen destination > copy destination id to clipboard.
* This example is especially useful for slack destinations which *must* be imported.
*
* 1. Add an empty resource to your terraform file:
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as newrelic from "@pulumi/newrelic";
*
* const foo = new newrelic.NotificationDestination("foo", {});
* ```
* 2. Run import command:
* - **Account scope** (default): `terraform import newrelic_notification_destination.foo `
* - **Organization scope**: `terraform import newrelic_notification_destination.foo :ORGANIZATION:`
* 3. Run the following command after the import successfully done and copy the information to your resource:
* `terraform state show newrelic_notification_destination.foo`
* 4. Add `ignoreChanges` attribute on `all` in your imported resource:
*/
export declare class NotificationDestination extends pulumi.CustomResource {
/**
* Get an existing NotificationDestination 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?: NotificationDestinationState, opts?: pulumi.CustomResourceOptions): NotificationDestination;
/**
* Returns true if the given object is an instance of NotificationDestination. 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 NotificationDestination;
/**
* Determines the New Relic account where the notification destination will be created. Defaults to the account associated with the API key used.
*/
readonly accountId: pulumi.Output;
/**
* Indicates whether the destination is active.
*/
readonly active: pulumi.Output;
/**
* A nested block that describes a basic username and password authentication credentials. Only one authBasic block is permitted per notification destination definition. See Nested authBasic blocks below for details.
*/
readonly authBasic: pulumi.Output;
/**
* A nested block that describes a custom header authentication credentials. This field is required when the destination type is WORKFLOW_AUTOMATION and optional for other destination types. Multiple blocks are permitted per notification destination definition. See Nested authCustomHeader blocks below for details.
*/
readonly authCustomHeaders: pulumi.Output;
/**
* A nested block that describes a token authentication credentials. Only one authToken block is permitted per notification destination definition. See Nested authToken blocks below for details.
*/
readonly authToken: pulumi.Output;
/**
* The unique entity identifier of the destination in New Relic.
*/
readonly guid: pulumi.Output;
/**
* The last time a notification was sent.
*/
readonly lastSent: pulumi.Output;
/**
* The name of the destination.
*/
readonly name: pulumi.Output;
/**
* A nested block that describes a notification destination property. See Nested property blocks below for details.
*/
readonly properties: pulumi.Output;
/**
* Scope of the destination
*/
readonly scope: pulumi.Output;
/**
* A nested block that describes a URL that contains sensitive data at the path or parameters. Only one secureUrl block is permitted per notification destination definition. See Nested secureUrl blocks below for details.
*/
readonly secureUrl: pulumi.Output;
/**
* The status of the destination.
*/
readonly status: pulumi.Output;
/**
* The type of destination. One of: `EMAIL`, `SERVICE_NOW`, `SERVICE_NOW_APP`, `WEBHOOK`, `JIRA`, `MOBILE_PUSH`, `EVENT_BRIDGE`, `PAGERDUTY_ACCOUNT_INTEGRATION` or `PAGERDUTY_SERVICE_INTEGRATION`, `MICROSOFT_TEAMS`, `WORKFLOW_AUTOMATION`. The types `SLACK` and `SLACK_COLLABORATION` can only be imported, updated and destroyed (cannot be created via terraform).
*/
readonly type: pulumi.Output;
/**
* Create a NotificationDestination 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: NotificationDestinationArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering NotificationDestination resources.
*/
export interface NotificationDestinationState {
/**
* Determines the New Relic account where the notification destination will be created. Defaults to the account associated with the API key used.
*/
accountId?: pulumi.Input;
/**
* Indicates whether the destination is active.
*/
active?: pulumi.Input;
/**
* A nested block that describes a basic username and password authentication credentials. Only one authBasic block is permitted per notification destination definition. See Nested authBasic blocks below for details.
*/
authBasic?: pulumi.Input;
/**
* A nested block that describes a custom header authentication credentials. This field is required when the destination type is WORKFLOW_AUTOMATION and optional for other destination types. Multiple blocks are permitted per notification destination definition. See Nested authCustomHeader blocks below for details.
*/
authCustomHeaders?: pulumi.Input[] | undefined>;
/**
* A nested block that describes a token authentication credentials. Only one authToken block is permitted per notification destination definition. See Nested authToken blocks below for details.
*/
authToken?: pulumi.Input;
/**
* The unique entity identifier of the destination in New Relic.
*/
guid?: pulumi.Input;
/**
* The last time a notification was sent.
*/
lastSent?: pulumi.Input;
/**
* The name of the destination.
*/
name?: pulumi.Input;
/**
* A nested block that describes a notification destination property. See Nested property blocks below for details.
*/
properties?: pulumi.Input[] | undefined>;
/**
* Scope of the destination
*/
scope?: pulumi.Input;
/**
* A nested block that describes a URL that contains sensitive data at the path or parameters. Only one secureUrl block is permitted per notification destination definition. See Nested secureUrl blocks below for details.
*/
secureUrl?: pulumi.Input;
/**
* The status of the destination.
*/
status?: pulumi.Input;
/**
* The type of destination. One of: `EMAIL`, `SERVICE_NOW`, `SERVICE_NOW_APP`, `WEBHOOK`, `JIRA`, `MOBILE_PUSH`, `EVENT_BRIDGE`, `PAGERDUTY_ACCOUNT_INTEGRATION` or `PAGERDUTY_SERVICE_INTEGRATION`, `MICROSOFT_TEAMS`, `WORKFLOW_AUTOMATION`. The types `SLACK` and `SLACK_COLLABORATION` can only be imported, updated and destroyed (cannot be created via terraform).
*/
type?: pulumi.Input;
}
/**
* The set of arguments for constructing a NotificationDestination resource.
*/
export interface NotificationDestinationArgs {
/**
* Determines the New Relic account where the notification destination will be created. Defaults to the account associated with the API key used.
*/
accountId?: pulumi.Input;
/**
* Indicates whether the destination is active.
*/
active?: pulumi.Input;
/**
* A nested block that describes a basic username and password authentication credentials. Only one authBasic block is permitted per notification destination definition. See Nested authBasic blocks below for details.
*/
authBasic?: pulumi.Input;
/**
* A nested block that describes a custom header authentication credentials. This field is required when the destination type is WORKFLOW_AUTOMATION and optional for other destination types. Multiple blocks are permitted per notification destination definition. See Nested authCustomHeader blocks below for details.
*/
authCustomHeaders?: pulumi.Input[] | undefined>;
/**
* A nested block that describes a token authentication credentials. Only one authToken block is permitted per notification destination definition. See Nested authToken blocks below for details.
*/
authToken?: pulumi.Input;
/**
* The name of the destination.
*/
name?: pulumi.Input;
/**
* A nested block that describes a notification destination property. See Nested property blocks below for details.
*/
properties: pulumi.Input[]>;
/**
* Scope of the destination
*/
scope?: pulumi.Input;
/**
* A nested block that describes a URL that contains sensitive data at the path or parameters. Only one secureUrl block is permitted per notification destination definition. See Nested secureUrl blocks below for details.
*/
secureUrl?: pulumi.Input;
/**
* The type of destination. One of: `EMAIL`, `SERVICE_NOW`, `SERVICE_NOW_APP`, `WEBHOOK`, `JIRA`, `MOBILE_PUSH`, `EVENT_BRIDGE`, `PAGERDUTY_ACCOUNT_INTEGRATION` or `PAGERDUTY_SERVICE_INTEGRATION`, `MICROSOFT_TEAMS`, `WORKFLOW_AUTOMATION`. The types `SLACK` and `SLACK_COLLABORATION` can only be imported, updated and destroyed (cannot be created via terraform).
*/
type: pulumi.Input;
}
//# sourceMappingURL=notificationDestination.d.ts.map