Opsgenie

v1.1.9 published on Tuesday, Aug 16, 2022 by Pulumi

AlertPolicy

Manages a Alert Policy within Opsgenie.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Opsgenie = Pulumi.Opsgenie;

return await Deployment.RunAsync(() => 
{
    var testTeam = new Opsgenie.Team("testTeam", new()
    {
        Description = "This team deals with all the things",
    });

    var testAlertPolicy = new Opsgenie.AlertPolicy("testAlertPolicy", new()
    {
        TeamId = testTeam.Id,
        PolicyDescription = "This is sample policy",
        Message = "{{message}}",
        Filters = new[]
        {
            ,
        },
        TimeRestrictions = new[]
        {
            new Opsgenie.Inputs.AlertPolicyTimeRestrictionArgs
            {
                Type = "weekday-and-time-of-day",
                RestrictionList = new[]
                {
                    new Opsgenie.Inputs.AlertPolicyTimeRestrictionRestrictionListArgs
                    {
                        EndDay = "monday",
                        EndHour = 7,
                        EndMin = 0,
                        StartDay = "sunday",
                        StartHour = 21,
                        StartMin = 0,
                    },
                    new Opsgenie.Inputs.AlertPolicyTimeRestrictionRestrictionListArgs
                    {
                        EndDay = "tuesday",
                        EndHour = 7,
                        EndMin = 0,
                        StartDay = "monday",
                        StartHour = 22,
                        StartMin = 0,
                    },
                },
            },
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-opsgenie/sdk/go/opsgenie"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		testTeam, err := opsgenie.NewTeam(ctx, "testTeam", &opsgenie.TeamArgs{
			Description: pulumi.String("This team deals with all the things"),
		})
		if err != nil {
			return err
		}
		_, err = opsgenie.NewAlertPolicy(ctx, "testAlertPolicy", &opsgenie.AlertPolicyArgs{
			TeamId:            testTeam.ID(),
			PolicyDescription: pulumi.String("This is sample policy"),
			Message:           pulumi.String("{{message}}"),
			Filters: AlertPolicyFilterArray{
				nil,
			},
			TimeRestrictions: AlertPolicyTimeRestrictionArray{
				&AlertPolicyTimeRestrictionArgs{
					Type: pulumi.String("weekday-and-time-of-day"),
					RestrictionList: AlertPolicyTimeRestrictionRestrictionListArray{
						&AlertPolicyTimeRestrictionRestrictionListArgs{
							EndDay:    pulumi.String("monday"),
							EndHour:   pulumi.Int(7),
							EndMin:    pulumi.Int(0),
							StartDay:  pulumi.String("sunday"),
							StartHour: pulumi.Int(21),
							StartMin:  pulumi.Int(0),
						},
						&AlertPolicyTimeRestrictionRestrictionListArgs{
							EndDay:    pulumi.String("tuesday"),
							EndHour:   pulumi.Int(7),
							EndMin:    pulumi.Int(0),
							StartDay:  pulumi.String("monday"),
							StartHour: pulumi.Int(22),
							StartMin:  pulumi.Int(0),
						},
					},
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.opsgenie.Team;
import com.pulumi.opsgenie.TeamArgs;
import com.pulumi.opsgenie.AlertPolicy;
import com.pulumi.opsgenie.AlertPolicyArgs;
import com.pulumi.opsgenie.inputs.AlertPolicyFilterArgs;
import com.pulumi.opsgenie.inputs.AlertPolicyTimeRestrictionArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var testTeam = new Team("testTeam", TeamArgs.builder()        
            .description("This team deals with all the things")
            .build());

        var testAlertPolicy = new AlertPolicy("testAlertPolicy", AlertPolicyArgs.builder()        
            .teamId(testTeam.id())
            .policyDescription("This is sample policy")
            .message("{{message}}")
            .filters()
            .timeRestrictions(AlertPolicyTimeRestrictionArgs.builder()
                .type("weekday-and-time-of-day")
                .restrictionList(                
                    AlertPolicyTimeRestrictionRestrictionListArgs.builder()
                        .endDay("monday")
                        .endHour(7)
                        .endMin(0)
                        .startDay("sunday")
                        .startHour(21)
                        .startMin(0)
                        .build(),
                    AlertPolicyTimeRestrictionRestrictionListArgs.builder()
                        .endDay("tuesday")
                        .endHour(7)
                        .endMin(0)
                        .startDay("monday")
                        .startHour(22)
                        .startMin(0)
                        .build())
                .build())
            .build());

    }
}
import pulumi
import pulumi_opsgenie as opsgenie

test_team = opsgenie.Team("testTeam", description="This team deals with all the things")
test_alert_policy = opsgenie.AlertPolicy("testAlertPolicy",
    team_id=test_team.id,
    policy_description="This is sample policy",
    message="{{message}}",
    filters=[opsgenie.AlertPolicyFilterArgs()],
    time_restrictions=[opsgenie.AlertPolicyTimeRestrictionArgs(
        type="weekday-and-time-of-day",
        restriction_list=[
            opsgenie.AlertPolicyTimeRestrictionRestrictionListArgs(
                end_day="monday",
                end_hour=7,
                end_min=0,
                start_day="sunday",
                start_hour=21,
                start_min=0,
            ),
            opsgenie.AlertPolicyTimeRestrictionRestrictionListArgs(
                end_day="tuesday",
                end_hour=7,
                end_min=0,
                start_day="monday",
                start_hour=22,
                start_min=0,
            ),
        ],
    )])
import * as pulumi from "@pulumi/pulumi";
import * as opsgenie from "@pulumi/opsgenie";

const testTeam = new opsgenie.Team("testTeam", {description: "This team deals with all the things"});
const testAlertPolicy = new opsgenie.AlertPolicy("testAlertPolicy", {
    teamId: testTeam.id,
    policyDescription: "This is sample policy",
    message: "{{message}}",
    filters: [{}],
    timeRestrictions: [{
        type: "weekday-and-time-of-day",
        restrictionList: [
            {
                endDay: "monday",
                endHour: 7,
                endMin: 0,
                startDay: "sunday",
                startHour: 21,
                startMin: 0,
            },
            {
                endDay: "tuesday",
                endHour: 7,
                endMin: 0,
                startDay: "monday",
                startHour: 22,
                startMin: 0,
            },
        ],
    }],
});
resources:
  testTeam:
    type: opsgenie:Team
    properties:
      description: This team deals with all the things
  testAlertPolicy:
    type: opsgenie:AlertPolicy
    properties:
      teamId: ${testTeam.id}
      policyDescription: This is sample policy
      message: '{{message}}'
      filters:
        - {}
      timeRestrictions:
        - type: weekday-and-time-of-day
          restrictionList:
            - endDay: monday
              endHour: 7
              endMin: 0
              startDay: sunday
              startHour: 21
              startMin: 0
            - endDay: tuesday
              endHour: 7
              endMin: 0
              startDay: monday
              startHour: 22
              startMin: 0

Create a AlertPolicy Resource

new AlertPolicy(name: string, args: AlertPolicyArgs, opts?: CustomResourceOptions);
@overload
def AlertPolicy(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                actions: Optional[Sequence[str]] = None,
                alert_description: Optional[str] = None,
                alias: Optional[str] = None,
                continue_policy: Optional[bool] = None,
                enabled: Optional[bool] = None,
                entity: Optional[str] = None,
                filters: Optional[Sequence[AlertPolicyFilterArgs]] = None,
                ignore_original_actions: Optional[bool] = None,
                ignore_original_details: Optional[bool] = None,
                ignore_original_responders: Optional[bool] = None,
                ignore_original_tags: Optional[bool] = None,
                message: Optional[str] = None,
                name: Optional[str] = None,
                policy_description: Optional[str] = None,
                priority: Optional[str] = None,
                responders: Optional[Sequence[AlertPolicyResponderArgs]] = None,
                source: Optional[str] = None,
                tags: Optional[Sequence[str]] = None,
                team_id: Optional[str] = None,
                time_restrictions: Optional[Sequence[AlertPolicyTimeRestrictionArgs]] = None)
@overload
def AlertPolicy(resource_name: str,
                args: AlertPolicyArgs,
                opts: Optional[ResourceOptions] = None)
func NewAlertPolicy(ctx *Context, name string, args AlertPolicyArgs, opts ...ResourceOption) (*AlertPolicy, error)
public AlertPolicy(string name, AlertPolicyArgs args, CustomResourceOptions? opts = null)
public AlertPolicy(String name, AlertPolicyArgs args)
public AlertPolicy(String name, AlertPolicyArgs args, CustomResourceOptions options)
type: opsgenie:AlertPolicy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args AlertPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args AlertPolicyArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args AlertPolicyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args AlertPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args AlertPolicyArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

AlertPolicy Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The AlertPolicy resource accepts the following input properties:

Message string

Message of the alerts

Actions List<string>

Actions to add to the alerts original actions value as a list of strings. If ignore_original_actions field is set to true, this will replace the original actions.

AlertDescription string

Description of the alert. You can use {{description}} to refer to the original alert description. Default: {{description}}

Alias string

Alias of the alert. You can use {{alias}} to refer to the original alias. Default: {{alias}}

ContinuePolicy bool

It will trigger other modify policies if set to true. Default: false

Enabled bool

If policy should be enabled. Default: true

Entity string

Entity field of the alert. You can use {{entity}} to refer to the original entity. Default: {{entity}}

Filters List<AlertPolicyFilterArgs>

A alert filter which will be applied. This filter can be empty: filter {} - this means match-all. This is a block, structure is documented below.

IgnoreOriginalActions bool

If set to true, policy will ignore the original actions of the alert. Default: false

IgnoreOriginalDetails bool

If set to true, policy will ignore the original details of the alert. Default: false

IgnoreOriginalResponders bool

If set to true, policy will ignore the original responders of the alert. Default: false

IgnoreOriginalTags bool

If set to true, policy will ignore the original tags of the alert. Default: false

Name string

Name of the responder

PolicyDescription string

Description of the policy. This can be max 512 characters.

Priority string

Priority of the alert. Should be one of P1, P2, P3, P4, or P5

Responders List<AlertPolicyResponderArgs>

Responders to add to the alerts original responders value as a list of teams, users or the reserved word none or all. If ignore_original_responders field is set to true, this will replace the original responders. The possible values for responders are: user, team. This is a block, structure is documented below.

Source string

Source field of the alert. You can use {{source}} to refer to the original source. Default: {{source}}

Tags List<string>

Tags to add to the alerts original tags value as a list of strings. If ignore_original_responders field is set to true, this will replace the original responders.

TeamId string

Id of team that this policy belongs to.

TimeRestrictions List<AlertPolicyTimeRestrictionArgs>

Time restrictions specified in this field must be met for this policy to work. This is a block, structure is documented below.

Message string

Message of the alerts

Actions []string

Actions to add to the alerts original actions value as a list of strings. If ignore_original_actions field is set to true, this will replace the original actions.

AlertDescription string

Description of the alert. You can use {{description}} to refer to the original alert description. Default: {{description}}

Alias string

Alias of the alert. You can use {{alias}} to refer to the original alias. Default: {{alias}}

ContinuePolicy bool

It will trigger other modify policies if set to true. Default: false

Enabled bool

If policy should be enabled. Default: true

Entity string

Entity field of the alert. You can use {{entity}} to refer to the original entity. Default: {{entity}}

Filters []AlertPolicyFilterArgs

A alert filter which will be applied. This filter can be empty: filter {} - this means match-all. This is a block, structure is documented below.

IgnoreOriginalActions bool

If set to true, policy will ignore the original actions of the alert. Default: false

IgnoreOriginalDetails bool

If set to true, policy will ignore the original details of the alert. Default: false

IgnoreOriginalResponders bool

If set to true, policy will ignore the original responders of the alert. Default: false

IgnoreOriginalTags bool

If set to true, policy will ignore the original tags of the alert. Default: false

Name string

Name of the responder

PolicyDescription string

Description of the policy. This can be max 512 characters.

Priority string

Priority of the alert. Should be one of P1, P2, P3, P4, or P5

Responders []AlertPolicyResponderArgs

Responders to add to the alerts original responders value as a list of teams, users or the reserved word none or all. If ignore_original_responders field is set to true, this will replace the original responders. The possible values for responders are: user, team. This is a block, structure is documented below.

Source string

Source field of the alert. You can use {{source}} to refer to the original source. Default: {{source}}

Tags []string

Tags to add to the alerts original tags value as a list of strings. If ignore_original_responders field is set to true, this will replace the original responders.

TeamId string

Id of team that this policy belongs to.

TimeRestrictions []AlertPolicyTimeRestrictionArgs

Time restrictions specified in this field must be met for this policy to work. This is a block, structure is documented below.

message String

Message of the alerts

actions List<String>

Actions to add to the alerts original actions value as a list of strings. If ignore_original_actions field is set to true, this will replace the original actions.

alertDescription String

Description of the alert. You can use {{description}} to refer to the original alert description. Default: {{description}}

alias String

Alias of the alert. You can use {{alias}} to refer to the original alias. Default: {{alias}}

continuePolicy Boolean

It will trigger other modify policies if set to true. Default: false

enabled Boolean

If policy should be enabled. Default: true

entity String

Entity field of the alert. You can use {{entity}} to refer to the original entity. Default: {{entity}}

filters List<AlertPolicyFilterArgs>

A alert filter which will be applied. This filter can be empty: filter {} - this means match-all. This is a block, structure is documented below.

ignoreOriginalActions Boolean

If set to true, policy will ignore the original actions of the alert. Default: false

ignoreOriginalDetails Boolean

If set to true, policy will ignore the original details of the alert. Default: false

ignoreOriginalResponders Boolean

If set to true, policy will ignore the original responders of the alert. Default: false

ignoreOriginalTags Boolean

If set to true, policy will ignore the original tags of the alert. Default: false

name String

Name of the responder

policyDescription String

Description of the policy. This can be max 512 characters.

priority String

Priority of the alert. Should be one of P1, P2, P3, P4, or P5

responders List<AlertPolicyResponderArgs>

Responders to add to the alerts original responders value as a list of teams, users or the reserved word none or all. If ignore_original_responders field is set to true, this will replace the original responders. The possible values for responders are: user, team. This is a block, structure is documented below.

source String

Source field of the alert. You can use {{source}} to refer to the original source. Default: {{source}}

tags List<String>

Tags to add to the alerts original tags value as a list of strings. If ignore_original_responders field is set to true, this will replace the original responders.

teamId String

Id of team that this policy belongs to.

timeRestrictions List<AlertPolicyTimeRestrictionArgs>

Time restrictions specified in this field must be met for this policy to work. This is a block, structure is documented below.

message string

Message of the alerts

actions string[]

Actions to add to the alerts original actions value as a list of strings. If ignore_original_actions field is set to true, this will replace the original actions.

alertDescription string

Description of the alert. You can use {{description}} to refer to the original alert description. Default: {{description}}

alias string

Alias of the alert. You can use {{alias}} to refer to the original alias. Default: {{alias}}

continuePolicy boolean

It will trigger other modify policies if set to true. Default: false

enabled boolean

If policy should be enabled. Default: true

entity string

Entity field of the alert. You can use {{entity}} to refer to the original entity. Default: {{entity}}

filters AlertPolicyFilterArgs[]

A alert filter which will be applied. This filter can be empty: filter {} - this means match-all. This is a block, structure is documented below.

ignoreOriginalActions boolean

If set to true, policy will ignore the original actions of the alert. Default: false

ignoreOriginalDetails boolean

If set to true, policy will ignore the original details of the alert. Default: false

ignoreOriginalResponders boolean

If set to true, policy will ignore the original responders of the alert. Default: false

ignoreOriginalTags boolean

If set to true, policy will ignore the original tags of the alert. Default: false

name string

Name of the responder

policyDescription string

Description of the policy. This can be max 512 characters.

priority string

Priority of the alert. Should be one of P1, P2, P3, P4, or P5

responders AlertPolicyResponderArgs[]

Responders to add to the alerts original responders value as a list of teams, users or the reserved word none or all. If ignore_original_responders field is set to true, this will replace the original responders. The possible values for responders are: user, team. This is a block, structure is documented below.

source string

Source field of the alert. You can use {{source}} to refer to the original source. Default: {{source}}

tags string[]

Tags to add to the alerts original tags value as a list of strings. If ignore_original_responders field is set to true, this will replace the original responders.

teamId string

Id of team that this policy belongs to.

timeRestrictions AlertPolicyTimeRestrictionArgs[]

Time restrictions specified in this field must be met for this policy to work. This is a block, structure is documented below.

message str

Message of the alerts

actions Sequence[str]

Actions to add to the alerts original actions value as a list of strings. If ignore_original_actions field is set to true, this will replace the original actions.

alert_description str

Description of the alert. You can use {{description}} to refer to the original alert description. Default: {{description}}

alias str

Alias of the alert. You can use {{alias}} to refer to the original alias. Default: {{alias}}

continue_policy bool

It will trigger other modify policies if set to true. Default: false

enabled bool

If policy should be enabled. Default: true

entity str

Entity field of the alert. You can use {{entity}} to refer to the original entity. Default: {{entity}}

filters Sequence[AlertPolicyFilterArgs]

A alert filter which will be applied. This filter can be empty: filter {} - this means match-all. This is a block, structure is documented below.

ignore_original_actions bool

If set to true, policy will ignore the original actions of the alert. Default: false

ignore_original_details bool

If set to true, policy will ignore the original details of the alert. Default: false

ignore_original_responders bool

If set to true, policy will ignore the original responders of the alert. Default: false

ignore_original_tags bool

If set to true, policy will ignore the original tags of the alert. Default: false

name str

Name of the responder

policy_description str

Description of the policy. This can be max 512 characters.

priority str

Priority of the alert. Should be one of P1, P2, P3, P4, or P5

responders Sequence[AlertPolicyResponderArgs]

Responders to add to the alerts original responders value as a list of teams, users or the reserved word none or all. If ignore_original_responders field is set to true, this will replace the original responders. The possible values for responders are: user, team. This is a block, structure is documented below.

source str

Source field of the alert. You can use {{source}} to refer to the original source. Default: {{source}}

tags Sequence[str]

Tags to add to the alerts original tags value as a list of strings. If ignore_original_responders field is set to true, this will replace the original responders.

team_id str

Id of team that this policy belongs to.

time_restrictions Sequence[AlertPolicyTimeRestrictionArgs]

Time restrictions specified in this field must be met for this policy to work. This is a block, structure is documented below.

message String

Message of the alerts

actions List<String>

Actions to add to the alerts original actions value as a list of strings. If ignore_original_actions field is set to true, this will replace the original actions.

alertDescription String

Description of the alert. You can use {{description}} to refer to the original alert description. Default: {{description}}

alias String

Alias of the alert. You can use {{alias}} to refer to the original alias. Default: {{alias}}

continuePolicy Boolean

It will trigger other modify policies if set to true. Default: false

enabled Boolean

If policy should be enabled. Default: true

entity String

Entity field of the alert. You can use {{entity}} to refer to the original entity. Default: {{entity}}

filters List<Property Map>

A alert filter which will be applied. This filter can be empty: filter {} - this means match-all. This is a block, structure is documented below.

ignoreOriginalActions Boolean

If set to true, policy will ignore the original actions of the alert. Default: false

ignoreOriginalDetails Boolean

If set to true, policy will ignore the original details of the alert. Default: false

ignoreOriginalResponders Boolean

If set to true, policy will ignore the original responders of the alert. Default: false

ignoreOriginalTags Boolean

If set to true, policy will ignore the original tags of the alert. Default: false

name String

Name of the responder

policyDescription String

Description of the policy. This can be max 512 characters.

priority String

Priority of the alert. Should be one of P1, P2, P3, P4, or P5

responders List<Property Map>

Responders to add to the alerts original responders value as a list of teams, users or the reserved word none or all. If ignore_original_responders field is set to true, this will replace the original responders. The possible values for responders are: user, team. This is a block, structure is documented below.

source String

Source field of the alert. You can use {{source}} to refer to the original source. Default: {{source}}

tags List<String>

Tags to add to the alerts original tags value as a list of strings. If ignore_original_responders field is set to true, this will replace the original responders.

teamId String

Id of team that this policy belongs to.

timeRestrictions List<Property Map>

Time restrictions specified in this field must be met for this policy to work. This is a block, structure is documented below.

Outputs

All input properties are implicitly available as output properties. Additionally, the AlertPolicy resource produces the following output properties:

Id string

The provider-assigned unique ID for this managed resource.

Id string

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

id string

The provider-assigned unique ID for this managed resource.

id str

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

Look up an Existing AlertPolicy Resource

Get an existing AlertPolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: AlertPolicyState, opts?: CustomResourceOptions): AlertPolicy
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        actions: Optional[Sequence[str]] = None,
        alert_description: Optional[str] = None,
        alias: Optional[str] = None,
        continue_policy: Optional[bool] = None,
        enabled: Optional[bool] = None,
        entity: Optional[str] = None,
        filters: Optional[Sequence[AlertPolicyFilterArgs]] = None,
        ignore_original_actions: Optional[bool] = None,
        ignore_original_details: Optional[bool] = None,
        ignore_original_responders: Optional[bool] = None,
        ignore_original_tags: Optional[bool] = None,
        message: Optional[str] = None,
        name: Optional[str] = None,
        policy_description: Optional[str] = None,
        priority: Optional[str] = None,
        responders: Optional[Sequence[AlertPolicyResponderArgs]] = None,
        source: Optional[str] = None,
        tags: Optional[Sequence[str]] = None,
        team_id: Optional[str] = None,
        time_restrictions: Optional[Sequence[AlertPolicyTimeRestrictionArgs]] = None) -> AlertPolicy
func GetAlertPolicy(ctx *Context, name string, id IDInput, state *AlertPolicyState, opts ...ResourceOption) (*AlertPolicy, error)
public static AlertPolicy Get(string name, Input<string> id, AlertPolicyState? state, CustomResourceOptions? opts = null)
public static AlertPolicy get(String name, Output<String> id, AlertPolicyState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Actions List<string>

Actions to add to the alerts original actions value as a list of strings. If ignore_original_actions field is set to true, this will replace the original actions.

AlertDescription string

Description of the alert. You can use {{description}} to refer to the original alert description. Default: {{description}}

Alias string

Alias of the alert. You can use {{alias}} to refer to the original alias. Default: {{alias}}

ContinuePolicy bool

It will trigger other modify policies if set to true. Default: false

Enabled bool

If policy should be enabled. Default: true

Entity string

Entity field of the alert. You can use {{entity}} to refer to the original entity. Default: {{entity}}

Filters List<AlertPolicyFilterArgs>

A alert filter which will be applied. This filter can be empty: filter {} - this means match-all. This is a block, structure is documented below.

IgnoreOriginalActions bool

If set to true, policy will ignore the original actions of the alert. Default: false

IgnoreOriginalDetails bool

If set to true, policy will ignore the original details of the alert. Default: false

IgnoreOriginalResponders bool

If set to true, policy will ignore the original responders of the alert. Default: false

IgnoreOriginalTags bool

If set to true, policy will ignore the original tags of the alert. Default: false

Message string

Message of the alerts

Name string

Name of the responder

PolicyDescription string

Description of the policy. This can be max 512 characters.

Priority string

Priority of the alert. Should be one of P1, P2, P3, P4, or P5

Responders List<AlertPolicyResponderArgs>

Responders to add to the alerts original responders value as a list of teams, users or the reserved word none or all. If ignore_original_responders field is set to true, this will replace the original responders. The possible values for responders are: user, team. This is a block, structure is documented below.

Source string

Source field of the alert. You can use {{source}} to refer to the original source. Default: {{source}}

Tags List<string>

Tags to add to the alerts original tags value as a list of strings. If ignore_original_responders field is set to true, this will replace the original responders.

TeamId string

Id of team that this policy belongs to.

TimeRestrictions List<AlertPolicyTimeRestrictionArgs>

Time restrictions specified in this field must be met for this policy to work. This is a block, structure is documented below.

Actions []string

Actions to add to the alerts original actions value as a list of strings. If ignore_original_actions field is set to true, this will replace the original actions.

AlertDescription string

Description of the alert. You can use {{description}} to refer to the original alert description. Default: {{description}}

Alias string

Alias of the alert. You can use {{alias}} to refer to the original alias. Default: {{alias}}

ContinuePolicy bool

It will trigger other modify policies if set to true. Default: false

Enabled bool

If policy should be enabled. Default: true

Entity string

Entity field of the alert. You can use {{entity}} to refer to the original entity. Default: {{entity}}

Filters []AlertPolicyFilterArgs

A alert filter which will be applied. This filter can be empty: filter {} - this means match-all. This is a block, structure is documented below.

IgnoreOriginalActions bool

If set to true, policy will ignore the original actions of the alert. Default: false

IgnoreOriginalDetails bool

If set to true, policy will ignore the original details of the alert. Default: false

IgnoreOriginalResponders bool

If set to true, policy will ignore the original responders of the alert. Default: false

IgnoreOriginalTags bool

If set to true, policy will ignore the original tags of the alert. Default: false

Message string

Message of the alerts

Name string

Name of the responder

PolicyDescription string

Description of the policy. This can be max 512 characters.

Priority string

Priority of the alert. Should be one of P1, P2, P3, P4, or P5

Responders []AlertPolicyResponderArgs

Responders to add to the alerts original responders value as a list of teams, users or the reserved word none or all. If ignore_original_responders field is set to true, this will replace the original responders. The possible values for responders are: user, team. This is a block, structure is documented below.

Source string

Source field of the alert. You can use {{source}} to refer to the original source. Default: {{source}}

Tags []string

Tags to add to the alerts original tags value as a list of strings. If ignore_original_responders field is set to true, this will replace the original responders.

TeamId string

Id of team that this policy belongs to.

TimeRestrictions []AlertPolicyTimeRestrictionArgs

Time restrictions specified in this field must be met for this policy to work. This is a block, structure is documented below.

actions List<String>

Actions to add to the alerts original actions value as a list of strings. If ignore_original_actions field is set to true, this will replace the original actions.

alertDescription String

Description of the alert. You can use {{description}} to refer to the original alert description. Default: {{description}}

alias String

Alias of the alert. You can use {{alias}} to refer to the original alias. Default: {{alias}}

continuePolicy Boolean

It will trigger other modify policies if set to true. Default: false

enabled Boolean

If policy should be enabled. Default: true

entity String

Entity field of the alert. You can use {{entity}} to refer to the original entity. Default: {{entity}}

filters List<AlertPolicyFilterArgs>

A alert filter which will be applied. This filter can be empty: filter {} - this means match-all. This is a block, structure is documented below.

ignoreOriginalActions Boolean

If set to true, policy will ignore the original actions of the alert. Default: false

ignoreOriginalDetails Boolean

If set to true, policy will ignore the original details of the alert. Default: false

ignoreOriginalResponders Boolean

If set to true, policy will ignore the original responders of the alert. Default: false

ignoreOriginalTags Boolean

If set to true, policy will ignore the original tags of the alert. Default: false

message String

Message of the alerts

name String

Name of the responder

policyDescription String

Description of the policy. This can be max 512 characters.

priority String

Priority of the alert. Should be one of P1, P2, P3, P4, or P5

responders List<AlertPolicyResponderArgs>

Responders to add to the alerts original responders value as a list of teams, users or the reserved word none or all. If ignore_original_responders field is set to true, this will replace the original responders. The possible values for responders are: user, team. This is a block, structure is documented below.

source String

Source field of the alert. You can use {{source}} to refer to the original source. Default: {{source}}

tags List<String>

Tags to add to the alerts original tags value as a list of strings. If ignore_original_responders field is set to true, this will replace the original responders.

teamId String

Id of team that this policy belongs to.

timeRestrictions List<AlertPolicyTimeRestrictionArgs>

Time restrictions specified in this field must be met for this policy to work. This is a block, structure is documented below.

actions string[]

Actions to add to the alerts original actions value as a list of strings. If ignore_original_actions field is set to true, this will replace the original actions.

alertDescription string

Description of the alert. You can use {{description}} to refer to the original alert description. Default: {{description}}

alias string

Alias of the alert. You can use {{alias}} to refer to the original alias. Default: {{alias}}

continuePolicy boolean

It will trigger other modify policies if set to true. Default: false

enabled boolean

If policy should be enabled. Default: true

entity string

Entity field of the alert. You can use {{entity}} to refer to the original entity. Default: {{entity}}

filters AlertPolicyFilterArgs[]

A alert filter which will be applied. This filter can be empty: filter {} - this means match-all. This is a block, structure is documented below.

ignoreOriginalActions boolean

If set to true, policy will ignore the original actions of the alert. Default: false

ignoreOriginalDetails boolean

If set to true, policy will ignore the original details of the alert. Default: false

ignoreOriginalResponders boolean

If set to true, policy will ignore the original responders of the alert. Default: false

ignoreOriginalTags boolean

If set to true, policy will ignore the original tags of the alert. Default: false

message string

Message of the alerts

name string

Name of the responder

policyDescription string

Description of the policy. This can be max 512 characters.

priority string

Priority of the alert. Should be one of P1, P2, P3, P4, or P5

responders AlertPolicyResponderArgs[]

Responders to add to the alerts original responders value as a list of teams, users or the reserved word none or all. If ignore_original_responders field is set to true, this will replace the original responders. The possible values for responders are: user, team. This is a block, structure is documented below.

source string

Source field of the alert. You can use {{source}} to refer to the original source. Default: {{source}}

tags string[]

Tags to add to the alerts original tags value as a list of strings. If ignore_original_responders field is set to true, this will replace the original responders.

teamId string

Id of team that this policy belongs to.

timeRestrictions AlertPolicyTimeRestrictionArgs[]

Time restrictions specified in this field must be met for this policy to work. This is a block, structure is documented below.

actions Sequence[str]

Actions to add to the alerts original actions value as a list of strings. If ignore_original_actions field is set to true, this will replace the original actions.

alert_description str

Description of the alert. You can use {{description}} to refer to the original alert description. Default: {{description}}

alias str

Alias of the alert. You can use {{alias}} to refer to the original alias. Default: {{alias}}

continue_policy bool

It will trigger other modify policies if set to true. Default: false

enabled bool

If policy should be enabled. Default: true

entity str

Entity field of the alert. You can use {{entity}} to refer to the original entity. Default: {{entity}}

filters Sequence[AlertPolicyFilterArgs]

A alert filter which will be applied. This filter can be empty: filter {} - this means match-all. This is a block, structure is documented below.

ignore_original_actions bool

If set to true, policy will ignore the original actions of the alert. Default: false

ignore_original_details bool

If set to true, policy will ignore the original details of the alert. Default: false

ignore_original_responders bool

If set to true, policy will ignore the original responders of the alert. Default: false

ignore_original_tags bool

If set to true, policy will ignore the original tags of the alert. Default: false

message str

Message of the alerts

name str

Name of the responder

policy_description str

Description of the policy. This can be max 512 characters.

priority str

Priority of the alert. Should be one of P1, P2, P3, P4, or P5

responders Sequence[AlertPolicyResponderArgs]

Responders to add to the alerts original responders value as a list of teams, users or the reserved word none or all. If ignore_original_responders field is set to true, this will replace the original responders. The possible values for responders are: user, team. This is a block, structure is documented below.

source str

Source field of the alert. You can use {{source}} to refer to the original source. Default: {{source}}

tags Sequence[str]

Tags to add to the alerts original tags value as a list of strings. If ignore_original_responders field is set to true, this will replace the original responders.

team_id str

Id of team that this policy belongs to.

time_restrictions Sequence[AlertPolicyTimeRestrictionArgs]

Time restrictions specified in this field must be met for this policy to work. This is a block, structure is documented below.

actions List<String>

Actions to add to the alerts original actions value as a list of strings. If ignore_original_actions field is set to true, this will replace the original actions.

alertDescription String

Description of the alert. You can use {{description}} to refer to the original alert description. Default: {{description}}

alias String

Alias of the alert. You can use {{alias}} to refer to the original alias. Default: {{alias}}

continuePolicy Boolean

It will trigger other modify policies if set to true. Default: false

enabled Boolean

If policy should be enabled. Default: true

entity String

Entity field of the alert. You can use {{entity}} to refer to the original entity. Default: {{entity}}

filters List<Property Map>

A alert filter which will be applied. This filter can be empty: filter {} - this means match-all. This is a block, structure is documented below.

ignoreOriginalActions Boolean

If set to true, policy will ignore the original actions of the alert. Default: false

ignoreOriginalDetails Boolean

If set to true, policy will ignore the original details of the alert. Default: false

ignoreOriginalResponders Boolean

If set to true, policy will ignore the original responders of the alert. Default: false

ignoreOriginalTags Boolean

If set to true, policy will ignore the original tags of the alert. Default: false

message String

Message of the alerts

name String

Name of the responder

policyDescription String

Description of the policy. This can be max 512 characters.

priority String

Priority of the alert. Should be one of P1, P2, P3, P4, or P5

responders List<Property Map>

Responders to add to the alerts original responders value as a list of teams, users or the reserved word none or all. If ignore_original_responders field is set to true, this will replace the original responders. The possible values for responders are: user, team. This is a block, structure is documented below.

source String

Source field of the alert. You can use {{source}} to refer to the original source. Default: {{source}}

tags List<String>

Tags to add to the alerts original tags value as a list of strings. If ignore_original_responders field is set to true, this will replace the original responders.

teamId String

Id of team that this policy belongs to.

timeRestrictions List<Property Map>

Time restrictions specified in this field must be met for this policy to work. This is a block, structure is documented below.

Supporting Types

AlertPolicyFilter

Conditions List<AlertPolicyFilterCondition>

Conditions applied to filter. This is a block, structure is documented below.

Type string

Type of responder. Acceptable values are: user or team

Conditions []AlertPolicyFilterCondition

Conditions applied to filter. This is a block, structure is documented below.

Type string

Type of responder. Acceptable values are: user or team

conditions List<AlertPolicyFilterCondition>

Conditions applied to filter. This is a block, structure is documented below.

type String

Type of responder. Acceptable values are: user or team

conditions AlertPolicyFilterCondition[]

Conditions applied to filter. This is a block, structure is documented below.

type string

Type of responder. Acceptable values are: user or team

conditions Sequence[AlertPolicyFilterCondition]

Conditions applied to filter. This is a block, structure is documented below.

type str

Type of responder. Acceptable values are: user or team

conditions List<Property Map>

Conditions applied to filter. This is a block, structure is documented below.

type String

Type of responder. Acceptable values are: user or team

AlertPolicyFilterCondition

Field string

Specifies which alert field will be used in condition. Possible values are message, alias, description, source, entity, tags, actions, details, extra-properties, recipients, teams, priority

Operation string

It is the operation that will be executed for the given field and key. Possible operations are matches, contains, starts-with, ends-with, equals, contains-key, contains-value, greater-than, less-than, is-empty, equals-ignore-whitespace.

ExpectedValue string

User defined value that will be compared with alert field according to the operation. Default: empty string

Key string

If field is set as extra-properties, key could be used for key-value pair

Not bool

Indicates behaviour of the given operation. Default: false

Order int

Order of the condition in conditions list

Field string

Specifies which alert field will be used in condition. Possible values are message, alias, description, source, entity, tags, actions, details, extra-properties, recipients, teams, priority

Operation string

It is the operation that will be executed for the given field and key. Possible operations are matches, contains, starts-with, ends-with, equals, contains-key, contains-value, greater-than, less-than, is-empty, equals-ignore-whitespace.

ExpectedValue string

User defined value that will be compared with alert field according to the operation. Default: empty string

Key string

If field is set as extra-properties, key could be used for key-value pair

Not bool

Indicates behaviour of the given operation. Default: false

Order int

Order of the condition in conditions list

field String

Specifies which alert field will be used in condition. Possible values are message, alias, description, source, entity, tags, actions, details, extra-properties, recipients, teams, priority

operation String

It is the operation that will be executed for the given field and key. Possible operations are matches, contains, starts-with, ends-with, equals, contains-key, contains-value, greater-than, less-than, is-empty, equals-ignore-whitespace.

expectedValue String

User defined value that will be compared with alert field according to the operation. Default: empty string

key String

If field is set as extra-properties, key could be used for key-value pair

not Boolean

Indicates behaviour of the given operation. Default: false

order Integer

Order of the condition in conditions list

field string

Specifies which alert field will be used in condition. Possible values are message, alias, description, source, entity, tags, actions, details, extra-properties, recipients, teams, priority

operation string

It is the operation that will be executed for the given field and key. Possible operations are matches, contains, starts-with, ends-with, equals, contains-key, contains-value, greater-than, less-than, is-empty, equals-ignore-whitespace.

expectedValue string

User defined value that will be compared with alert field according to the operation. Default: empty string

key string

If field is set as extra-properties, key could be used for key-value pair

not boolean

Indicates behaviour of the given operation. Default: false

order number

Order of the condition in conditions list

field str

Specifies which alert field will be used in condition. Possible values are message, alias, description, source, entity, tags, actions, details, extra-properties, recipients, teams, priority

operation str

It is the operation that will be executed for the given field and key. Possible operations are matches, contains, starts-with, ends-with, equals, contains-key, contains-value, greater-than, less-than, is-empty, equals-ignore-whitespace.

expected_value str

User defined value that will be compared with alert field according to the operation. Default: empty string

key str

If field is set as extra-properties, key could be used for key-value pair

not_ bool

Indicates behaviour of the given operation. Default: false

order int

Order of the condition in conditions list

field String

Specifies which alert field will be used in condition. Possible values are message, alias, description, source, entity, tags, actions, details, extra-properties, recipients, teams, priority

operation String

It is the operation that will be executed for the given field and key. Possible operations are matches, contains, starts-with, ends-with, equals, contains-key, contains-value, greater-than, less-than, is-empty, equals-ignore-whitespace.

expectedValue String

User defined value that will be compared with alert field according to the operation. Default: empty string

key String

If field is set as extra-properties, key could be used for key-value pair

not Boolean

Indicates behaviour of the given operation. Default: false

order Number

Order of the condition in conditions list

AlertPolicyResponder

Id string

ID of the responder

Type string

Type of responder. Acceptable values are: user or team

Name string

Name of the responder

Username string

Username of the responder

Id string

ID of the responder

Type string

Type of responder. Acceptable values are: user or team

Name string

Name of the responder

Username string

Username of the responder

id String

ID of the responder

type String

Type of responder. Acceptable values are: user or team

name String

Name of the responder

username String

Username of the responder

id string

ID of the responder

type string

Type of responder. Acceptable values are: user or team

name string

Name of the responder

username string

Username of the responder

id str

ID of the responder

type str

Type of responder. Acceptable values are: user or team

name str

Name of the responder

username str

Username of the responder

id String

ID of the responder

type String

Type of responder. Acceptable values are: user or team

name String

Name of the responder

username String

Username of the responder

AlertPolicyTimeRestriction

Type string

Type of responder. Acceptable values are: user or team

Restriction List<AlertPolicyTimeRestrictionRestriction>

A definition of hourly definition applied daily, this has to be used with combination: type = time-of-day. This is a block, structure is documented below.

RestrictionList List<AlertPolicyTimeRestrictionRestrictionList>

List of days and hours definitions for field type = weekday-and-time-of-day. This is a block, structure is documented below.

Type string

Type of responder. Acceptable values are: user or team

Restriction []AlertPolicyTimeRestrictionRestriction

A definition of hourly definition applied daily, this has to be used with combination: type = time-of-day. This is a block, structure is documented below.

RestrictionList []AlertPolicyTimeRestrictionRestrictionList

List of days and hours definitions for field type = weekday-and-time-of-day. This is a block, structure is documented below.

type String

Type of responder. Acceptable values are: user or team

restriction List<AlertPolicyTimeRestrictionRestriction>

A definition of hourly definition applied daily, this has to be used with combination: type = time-of-day. This is a block, structure is documented below.

restrictionList List<AlertPolicyTimeRestrictionRestrictionList>

List of days and hours definitions for field type = weekday-and-time-of-day. This is a block, structure is documented below.

type string

Type of responder. Acceptable values are: user or team

restriction AlertPolicyTimeRestrictionRestriction[]

A definition of hourly definition applied daily, this has to be used with combination: type = time-of-day. This is a block, structure is documented below.

restrictionList AlertPolicyTimeRestrictionRestrictionList[]

List of days and hours definitions for field type = weekday-and-time-of-day. This is a block, structure is documented below.

type str

Type of responder. Acceptable values are: user or team

restriction Sequence[AlertPolicyTimeRestrictionRestriction]

A definition of hourly definition applied daily, this has to be used with combination: type = time-of-day. This is a block, structure is documented below.

restriction_list Sequence[AlertPolicyTimeRestrictionRestrictionList]

List of days and hours definitions for field type = weekday-and-time-of-day. This is a block, structure is documented below.

type String

Type of responder. Acceptable values are: user or team

restriction List<Property Map>

A definition of hourly definition applied daily, this has to be used with combination: type = time-of-day. This is a block, structure is documented below.

restrictionList List<Property Map>

List of days and hours definitions for field type = weekday-and-time-of-day. This is a block, structure is documented below.

AlertPolicyTimeRestrictionRestriction

EndHour int

Ending hour of restriction.

EndMin int

Ending minute of restriction on defined end_hour

StartHour int

Starting hour of restriction.

StartMin int

Staring minute of restriction on defined start_hour

EndHour int

Ending hour of restriction.

EndMin int

Ending minute of restriction on defined end_hour

StartHour int

Starting hour of restriction.

StartMin int

Staring minute of restriction on defined start_hour

endHour Integer

Ending hour of restriction.

endMin Integer

Ending minute of restriction on defined end_hour

startHour Integer

Starting hour of restriction.

startMin Integer

Staring minute of restriction on defined start_hour

endHour number

Ending hour of restriction.

endMin number

Ending minute of restriction on defined end_hour

startHour number

Starting hour of restriction.

startMin number

Staring minute of restriction on defined start_hour

end_hour int

Ending hour of restriction.

end_min int

Ending minute of restriction on defined end_hour

start_hour int

Starting hour of restriction.

start_min int

Staring minute of restriction on defined start_hour

endHour Number

Ending hour of restriction.

endMin Number

Ending minute of restriction on defined end_hour

startHour Number

Starting hour of restriction.

startMin Number

Staring minute of restriction on defined start_hour

AlertPolicyTimeRestrictionRestrictionList

EndDay string

Ending day of restriction (eg. wednesday)

EndHour int

Ending hour of restriction.

EndMin int

Ending minute of restriction on defined end_hour

StartDay string

Starting day of restriction (eg. monday)

StartHour int

Starting hour of restriction.

StartMin int

Staring minute of restriction on defined start_hour

EndDay string

Ending day of restriction (eg. wednesday)

EndHour int

Ending hour of restriction.

EndMin int

Ending minute of restriction on defined end_hour

StartDay string

Starting day of restriction (eg. monday)

StartHour int

Starting hour of restriction.

StartMin int

Staring minute of restriction on defined start_hour

endDay String

Ending day of restriction (eg. wednesday)

endHour Integer

Ending hour of restriction.

endMin Integer

Ending minute of restriction on defined end_hour

startDay String

Starting day of restriction (eg. monday)

startHour Integer

Starting hour of restriction.

startMin Integer

Staring minute of restriction on defined start_hour

endDay string

Ending day of restriction (eg. wednesday)

endHour number

Ending hour of restriction.

endMin number

Ending minute of restriction on defined end_hour

startDay string

Starting day of restriction (eg. monday)

startHour number

Starting hour of restriction.

startMin number

Staring minute of restriction on defined start_hour

end_day str

Ending day of restriction (eg. wednesday)

end_hour int

Ending hour of restriction.

end_min int

Ending minute of restriction on defined end_hour

start_day str

Starting day of restriction (eg. monday)

start_hour int

Starting hour of restriction.

start_min int

Staring minute of restriction on defined start_hour

endDay String

Ending day of restriction (eg. wednesday)

endHour Number

Ending hour of restriction.

endMin Number

Ending minute of restriction on defined end_hour

startDay String

Starting day of restriction (eg. monday)

startHour Number

Starting hour of restriction.

startMin Number

Staring minute of restriction on defined start_hour

Import

Alert policies can be imported using the team_id/policy_id, e.g.

 $ pulumi import opsgenie:index/alertPolicy:AlertPolicy test team_id/policy_id`

You can import global polices using only policy identifier

 $ pulumi import opsgenie:index/alertPolicy:AlertPolicy test policy_id`

Package Details

Repository
https://github.com/pulumi/pulumi-opsgenie
License
Apache-2.0
Notes

This Pulumi package is based on the opsgenie Terraform Provider.