import * as pulumi from "@pulumi/pulumi";
/**
* Use this resource to create and manage New Relic alert policies.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as newrelic from "@pulumi/newrelic";
*
* const foo = new newrelic.AlertPolicy("foo", {
* name: "example",
* incidentPreference: "PER_POLICY",
* });
* ```
* See additional examples.
*
* ## Additional Examples
*
* ##### Provision multiple notification channels and add those channels to a policy
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as newrelic from "@pulumi/newrelic";
*
* // Provision a Slack notification channel.
* const slackChannel = new newrelic.AlertChannel("slack_channel", {
* name: "slack-example",
* type: "slack",
* config: {
* url: "https://hooks.slack.com/services/<*****>/<*****>",
* channel: "example-alerts-channel",
* },
* });
* // Provision an email notification channel.
* const emailChannel = new newrelic.AlertChannel("email_channel", {
* name: "email-example",
* type: "email",
* config: {
* recipients: "example@testing.com",
* includeJsonAttachment: "1",
* },
* });
* // Provision the alert policy.
* const policyWithChannels = new newrelic.AlertPolicy("policy_with_channels", {
* name: "example-with-channels",
* incidentPreference: "PER_CONDITION",
* channelIds: [
* slackChannel.id,
* emailChannel.id,
* ],
* });
* ```
*
*
* ##### Reference existing notification channels and add those channel to a policy
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as newrelic from "@pulumi/newrelic";
*
* // Reference an existing Slack notification channel.
* const slackChannel = newrelic.getAlertChannel({
* name: "slack-channel-notification",
* });
* // Reference an existing email notification channel.
* const emailChannel = newrelic.getAlertChannel({
* name: "test@example.com",
* });
* // Provision the alert policy.
* const policyWithChannels = new newrelic.AlertPolicy("policy_with_channels", {
* name: "example-with-channels",
* incidentPreference: "PER_CONDITION",
* channelIds: [
* slackChannel.then(slackChannel => slackChannel.id),
* emailChannel.then(emailChannel => emailChannel.id),
* ],
* });
* ```
*
* ## Import
*
* Alert policies can be imported using a composite ID of `:`, where `accountId` is the account number scoped to the alert policy resource.
*
* Example import:
*
* ```sh
* $ pulumi import newrelic:index/alertPolicy:AlertPolicy foo 23423556:4593020
* ```
*
* Please note that channel IDs (`channelIds`) _cannot_ be imported due channels being a separate resource. However, to add channels to an imported alert policy, you can import the policy, add the `channelIds` attribute with the associated channel IDs, then run `pulumi up`. This will result in the original alert policy being destroyed and a new alert policy being created along with the channels being added to the policy.
*/
export declare class AlertPolicy extends pulumi.CustomResource {
/**
* Get an existing AlertPolicy 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?: AlertPolicyState, opts?: pulumi.CustomResourceOptions): AlertPolicy;
/**
* Returns true if the given object is an instance of AlertPolicy. 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 AlertPolicy;
/**
* The New Relic account ID to operate on. This allows the user to override the `accountId` attribute set on the provider. Defaults to the environment variable `NEW_RELIC_ACCOUNT_ID`.
*/
readonly accountId: pulumi.Output;
/**
* **DEPRECATED** The `channelIds` argument is deprecated and will be removed in the next major release of the provider. An array of channel IDs (integers) to assign to the policy. Adding or removing channel IDs from this array will result in a new alert policy resource being created and the old one being destroyed. Also note that channel IDs _cannot_ be imported via `pulumi import` (see Import for info).
*
* @deprecated The `channelIds` attribute is deprecated and will be removed in the next major release of the provider.
*/
readonly channelIds: pulumi.Output;
/**
* The entity GUID of the alert policy.
*/
readonly entityGuid: pulumi.Output;
/**
* The rollup strategy for the policy, which can have one of the following values (the default value is `PER_POLICY`):
* * `PER_POLICY` - This sets the incident grouping preference of the policy to **One issue per policy**. Refer to [this page](https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alert-policies/specify-when-alerts-create-incidents/#preference-policy) for more details on this incident grouping preference.
* * `PER_CONDITION` - This sets the incident grouping preference of the policy to **One issue per condition**. Refer to [this page](https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alert-policies/specify-when-alerts-create-incidents/#preference-condition) for more details on this incident grouping preference.
* * `PER_CONDITION_AND_TARGET` - This sets the incident grouping preference of the policy to **One issue per condition and signal**. Refer to [this page](https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alert-policies/specify-when-alerts-create-incidents/#preference-signal) for more details on this incident grouping preference.
*/
readonly incidentPreference: pulumi.Output;
/**
* The name of the policy.
*/
readonly name: pulumi.Output;
/**
* Create a AlertPolicy 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?: AlertPolicyArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering AlertPolicy resources.
*/
export interface AlertPolicyState {
/**
* The New Relic account ID to operate on. This allows the user to override the `accountId` attribute set on the provider. Defaults to the environment variable `NEW_RELIC_ACCOUNT_ID`.
*/
accountId?: pulumi.Input;
/**
* **DEPRECATED** The `channelIds` argument is deprecated and will be removed in the next major release of the provider. An array of channel IDs (integers) to assign to the policy. Adding or removing channel IDs from this array will result in a new alert policy resource being created and the old one being destroyed. Also note that channel IDs _cannot_ be imported via `pulumi import` (see Import for info).
*
* @deprecated The `channelIds` attribute is deprecated and will be removed in the next major release of the provider.
*/
channelIds?: pulumi.Input[] | undefined>;
/**
* The entity GUID of the alert policy.
*/
entityGuid?: pulumi.Input;
/**
* The rollup strategy for the policy, which can have one of the following values (the default value is `PER_POLICY`):
* * `PER_POLICY` - This sets the incident grouping preference of the policy to **One issue per policy**. Refer to [this page](https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alert-policies/specify-when-alerts-create-incidents/#preference-policy) for more details on this incident grouping preference.
* * `PER_CONDITION` - This sets the incident grouping preference of the policy to **One issue per condition**. Refer to [this page](https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alert-policies/specify-when-alerts-create-incidents/#preference-condition) for more details on this incident grouping preference.
* * `PER_CONDITION_AND_TARGET` - This sets the incident grouping preference of the policy to **One issue per condition and signal**. Refer to [this page](https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alert-policies/specify-when-alerts-create-incidents/#preference-signal) for more details on this incident grouping preference.
*/
incidentPreference?: pulumi.Input;
/**
* The name of the policy.
*/
name?: pulumi.Input;
}
/**
* The set of arguments for constructing a AlertPolicy resource.
*/
export interface AlertPolicyArgs {
/**
* The New Relic account ID to operate on. This allows the user to override the `accountId` attribute set on the provider. Defaults to the environment variable `NEW_RELIC_ACCOUNT_ID`.
*/
accountId?: pulumi.Input;
/**
* **DEPRECATED** The `channelIds` argument is deprecated and will be removed in the next major release of the provider. An array of channel IDs (integers) to assign to the policy. Adding or removing channel IDs from this array will result in a new alert policy resource being created and the old one being destroyed. Also note that channel IDs _cannot_ be imported via `pulumi import` (see Import for info).
*
* @deprecated The `channelIds` attribute is deprecated and will be removed in the next major release of the provider.
*/
channelIds?: pulumi.Input[] | undefined>;
/**
* The rollup strategy for the policy, which can have one of the following values (the default value is `PER_POLICY`):
* * `PER_POLICY` - This sets the incident grouping preference of the policy to **One issue per policy**. Refer to [this page](https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alert-policies/specify-when-alerts-create-incidents/#preference-policy) for more details on this incident grouping preference.
* * `PER_CONDITION` - This sets the incident grouping preference of the policy to **One issue per condition**. Refer to [this page](https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alert-policies/specify-when-alerts-create-incidents/#preference-condition) for more details on this incident grouping preference.
* * `PER_CONDITION_AND_TARGET` - This sets the incident grouping preference of the policy to **One issue per condition and signal**. Refer to [this page](https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/alert-policies/specify-when-alerts-create-incidents/#preference-signal) for more details on this incident grouping preference.
*/
incidentPreference?: pulumi.Input;
/**
* The name of the policy.
*/
name?: pulumi.Input;
}
//# sourceMappingURL=alertPolicy.d.ts.map