Welcome to Pulumi Registry, your window into the cloud. Read the announcement.

Opsgenie

v1.1.0 published on Thursday, Nov 11, 2021 by Pulumi

AlertPolicy

Manages a Alert Policy within Opsgenie.

Example Usage

using Pulumi;
using Opsgenie = Pulumi.Opsgenie;

class MyStack : Stack
{
    public MyStack()
    {
        var testTeam = new Opsgenie.Team("testTeam", new Opsgenie.TeamArgs
        {
            Description = "This team deals with all the things",
        });
        var testAlertPolicy = new Opsgenie.AlertPolicy("testAlertPolicy", new Opsgenie.AlertPolicyArgs
        {
            TeamId = testTeam.Id,
            PolicyDescription = "This is sample policy",
            Message = "{{message}}",
            Filters = 
            {
                ,
            },
            TimeRestrictions = 
            {
                new Opsgenie.Inputs.AlertPolicyTimeRestrictionArgs
                {
                    Type = "weekday-and-time-of-day",
                    Restrictions = 
                    {
                        new Opsgenie.Inputs.AlertPolicyTimeRestrictionRestrictionArgs
                        {
                            EndDay = "monday",
                            EndHour = 7,
                            EndMin = 0,
                            StartDay = "sunday",
                            StartHour = 21,
                            StartMin = 0,
                        },
                        new Opsgenie.Inputs.AlertPolicyTimeRestrictionRestrictionArgs
                        {
                            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"),
					Restrictions: AlertPolicyTimeRestrictionRestrictionArray{
						&AlertPolicyTimeRestrictionRestrictionArgs{
							EndDay:    pulumi.String("monday"),
							EndHour:   pulumi.Int(7),
							EndMin:    pulumi.Int(0),
							StartDay:  pulumi.String("sunday"),
							StartHour: pulumi.Int(21),
							StartMin:  pulumi.Int(0),
						},
						&AlertPolicyTimeRestrictionRestrictionArgs{
							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
	})
}
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",
        restrictions=[
            opsgenie.AlertPolicyTimeRestrictionRestrictionArgs(
                end_day="monday",
                end_hour=7,
                end_min=0,
                start_day="sunday",
                start_hour=21,
                start_min=0,
            ),
            opsgenie.AlertPolicyTimeRestrictionRestrictionArgs(
                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",
        restrictions: [
            {
                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)
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.

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 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.

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 str
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)
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.

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 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.

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 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

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 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

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 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

AlertPolicyTimeRestriction

Type string
Type of responder. Acceptable values are: user or team
Restrictions List<AlertPolicyTimeRestrictionRestriction>
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
Restrictions []AlertPolicyTimeRestrictionRestriction
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
restrictions AlertPolicyTimeRestrictionRestriction[]
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
restrictions Sequence[AlertPolicyTimeRestrictionRestriction]
List of days and hours definitions for field type = weekday-and-time-of-day. This is a block, structure is documented below.

AlertPolicyTimeRestrictionRestriction

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 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

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.