opsgenie.AlertPolicy
Explore with Pulumi AI
Manages a Alert Policy within Opsgenie.
Example Usage
using System.Collections.Generic;
using System.Linq;
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[]
{
null,
},
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: opsgenie.AlertPolicyFilterArray{
nil,
},
TimeRestrictions: opsgenie.AlertPolicyTimeRestrictionArray{
&opsgenie.AlertPolicyTimeRestrictionArgs{
Type: pulumi.String("weekday-and-time-of-day"),
RestrictionList: opsgenie.AlertPolicyTimeRestrictionRestrictionListArray{
&opsgenie.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),
},
&opsgenie.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 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 totrue
, this will replace the original actions.- Alert
Description 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}}
- 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 string
Entity field of the alert. You can use
{{entity}}
to refer to the original entity. Default:{{entity}}
- Filters
List<Alert
Policy Filter Args> A alert filter which will be applied. This filter can be empty:
filter {}
- this meansmatch-all
. This is a block, structure is documented below.- Ignore
Original boolActions If set to
true
, policy will ignore the original actions of the alert. Default:false
- Ignore
Original boolDetails If set to
true
, policy will ignore the original details of the alert. Default:false
- Ignore
Original boolResponders If set to
true
, policy will ignore the original responders of the alert. Default:false
- bool
If set to
true
, policy will ignore the original tags of the alert. Default:false
- Name string
Name of the alert policy
- Policy
Description 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
, orP5
- Responders
List<Alert
Policy Responder Args> 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 totrue
, 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}}
- List<string>
Tags to add to the alerts original tags value as a list of strings. If
ignore_original_responders
field is set totrue
, this will replace the original responders.- Team
Id string Id of team that this policy belongs to.
- Time
Restrictions List<AlertPolicy Time Restriction Args> 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 totrue
, this will replace the original actions.- Alert
Description 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}}
- 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 string
Entity field of the alert. You can use
{{entity}}
to refer to the original entity. Default:{{entity}}
- Filters
[]Alert
Policy Filter Args A alert filter which will be applied. This filter can be empty:
filter {}
- this meansmatch-all
. This is a block, structure is documented below.- Ignore
Original boolActions If set to
true
, policy will ignore the original actions of the alert. Default:false
- Ignore
Original boolDetails If set to
true
, policy will ignore the original details of the alert. Default:false
- Ignore
Original boolResponders If set to
true
, policy will ignore the original responders of the alert. Default:false
- bool
If set to
true
, policy will ignore the original tags of the alert. Default:false
- Name string
Name of the alert policy
- Policy
Description 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
, orP5
- Responders
[]Alert
Policy Responder Args 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 totrue
, 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}}
- []string
Tags to add to the alerts original tags value as a list of strings. If
ignore_original_responders
field is set totrue
, this will replace the original responders.- Team
Id string Id of team that this policy belongs to.
- Time
Restrictions []AlertPolicy Time Restriction Args 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 totrue
, this will replace the original actions.- alert
Description 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}}
- continue
Policy 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<Alert
Policy Filter Args> A alert filter which will be applied. This filter can be empty:
filter {}
- this meansmatch-all
. This is a block, structure is documented below.- ignore
Original BooleanActions If set to
true
, policy will ignore the original actions of the alert. Default:false
- ignore
Original BooleanDetails If set to
true
, policy will ignore the original details of the alert. Default:false
- ignore
Original BooleanResponders If set to
true
, policy will ignore the original responders of the alert. Default:false
- Boolean
If set to
true
, policy will ignore the original tags of the alert. Default:false
- name String
Name of the alert policy
- policy
Description 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
, orP5
- responders
List<Alert
Policy Responder Args> 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 totrue
, 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}}
- List<String>
Tags to add to the alerts original tags value as a list of strings. If
ignore_original_responders
field is set totrue
, this will replace the original responders.- team
Id String Id of team that this policy belongs to.
- time
Restrictions List<AlertPolicy Time Restriction Args> 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 totrue
, this will replace the original actions.- alert
Description 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}}
- continue
Policy 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
Alert
Policy Filter Args[] A alert filter which will be applied. This filter can be empty:
filter {}
- this meansmatch-all
. This is a block, structure is documented below.- ignore
Original booleanActions If set to
true
, policy will ignore the original actions of the alert. Default:false
- ignore
Original booleanDetails If set to
true
, policy will ignore the original details of the alert. Default:false
- ignore
Original booleanResponders If set to
true
, policy will ignore the original responders of the alert. Default:false
- boolean
If set to
true
, policy will ignore the original tags of the alert. Default:false
- name string
Name of the alert policy
- policy
Description 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
, orP5
- responders
Alert
Policy Responder Args[] 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 totrue
, 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}}
- string[]
Tags to add to the alerts original tags value as a list of strings. If
ignore_original_responders
field is set totrue
, this will replace the original responders.- team
Id string Id of team that this policy belongs to.
- time
Restrictions AlertPolicy Time Restriction Args[] 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 totrue
, 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[Alert
Policy Filter Args] A alert filter which will be applied. This filter can be empty:
filter {}
- this meansmatch-all
. This is a block, structure is documented below.- ignore_
original_ boolactions If set to
true
, policy will ignore the original actions of the alert. Default:false
- ignore_
original_ booldetails If set to
true
, policy will ignore the original details of the alert. Default:false
- ignore_
original_ boolresponders If set to
true
, policy will ignore the original responders of the alert. Default:false
- bool
If set to
true
, policy will ignore the original tags of the alert. Default:false
- name str
Name of the alert policy
- 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
, orP5
- responders
Sequence[Alert
Policy Responder Args] 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 totrue
, 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}}
- Sequence[str]
Tags to add to the alerts original tags value as a list of strings. If
ignore_original_responders
field is set totrue
, this will replace the original responders.- team_
id str Id of team that this policy belongs to.
- time_
restrictions Sequence[AlertPolicy Time Restriction Args] 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 totrue
, this will replace the original actions.- alert
Description 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}}
- continue
Policy 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 meansmatch-all
. This is a block, structure is documented below.- ignore
Original BooleanActions If set to
true
, policy will ignore the original actions of the alert. Default:false
- ignore
Original BooleanDetails If set to
true
, policy will ignore the original details of the alert. Default:false
- ignore
Original BooleanResponders If set to
true
, policy will ignore the original responders of the alert. Default:false
- Boolean
If set to
true
, policy will ignore the original tags of the alert. Default:false
- name String
Name of the alert policy
- policy
Description 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
, orP5
- 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 totrue
, 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}}
- List<String>
Tags to add to the alerts original tags value as a list of strings. If
ignore_original_responders
field is set totrue
, this will replace the original responders.- team
Id String Id of team that this policy belongs to.
- time
Restrictions 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 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.
- Actions List<string>
Actions to add to the alerts original actions value as a list of strings. If
ignore_original_actions
field is set totrue
, this will replace the original actions.- Alert
Description 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}}
- 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 string
Entity field of the alert. You can use
{{entity}}
to refer to the original entity. Default:{{entity}}
- Filters
List<Alert
Policy Filter Args> A alert filter which will be applied. This filter can be empty:
filter {}
- this meansmatch-all
. This is a block, structure is documented below.- Ignore
Original boolActions If set to
true
, policy will ignore the original actions of the alert. Default:false
- Ignore
Original boolDetails If set to
true
, policy will ignore the original details of the alert. Default:false
- Ignore
Original boolResponders If set to
true
, policy will ignore the original responders of the alert. Default:false
- 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 alert policy
- Policy
Description 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
, orP5
- Responders
List<Alert
Policy Responder Args> 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 totrue
, 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}}
- List<string>
Tags to add to the alerts original tags value as a list of strings. If
ignore_original_responders
field is set totrue
, this will replace the original responders.- Team
Id string Id of team that this policy belongs to.
- Time
Restrictions List<AlertPolicy Time Restriction Args> 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 totrue
, this will replace the original actions.- Alert
Description 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}}
- 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 string
Entity field of the alert. You can use
{{entity}}
to refer to the original entity. Default:{{entity}}
- Filters
[]Alert
Policy Filter Args A alert filter which will be applied. This filter can be empty:
filter {}
- this meansmatch-all
. This is a block, structure is documented below.- Ignore
Original boolActions If set to
true
, policy will ignore the original actions of the alert. Default:false
- Ignore
Original boolDetails If set to
true
, policy will ignore the original details of the alert. Default:false
- Ignore
Original boolResponders If set to
true
, policy will ignore the original responders of the alert. Default:false
- 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 alert policy
- Policy
Description 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
, orP5
- Responders
[]Alert
Policy Responder Args 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 totrue
, 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}}
- []string
Tags to add to the alerts original tags value as a list of strings. If
ignore_original_responders
field is set totrue
, this will replace the original responders.- Team
Id string Id of team that this policy belongs to.
- Time
Restrictions []AlertPolicy Time Restriction Args 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 totrue
, this will replace the original actions.- alert
Description 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}}
- continue
Policy 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<Alert
Policy Filter Args> A alert filter which will be applied. This filter can be empty:
filter {}
- this meansmatch-all
. This is a block, structure is documented below.- ignore
Original BooleanActions If set to
true
, policy will ignore the original actions of the alert. Default:false
- ignore
Original BooleanDetails If set to
true
, policy will ignore the original details of the alert. Default:false
- ignore
Original BooleanResponders If set to
true
, policy will ignore the original responders of the alert. Default:false
- 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 alert policy
- policy
Description 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
, orP5
- responders
List<Alert
Policy Responder Args> 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 totrue
, 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}}
- List<String>
Tags to add to the alerts original tags value as a list of strings. If
ignore_original_responders
field is set totrue
, this will replace the original responders.- team
Id String Id of team that this policy belongs to.
- time
Restrictions List<AlertPolicy Time Restriction Args> 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 totrue
, this will replace the original actions.- alert
Description 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}}
- continue
Policy 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
Alert
Policy Filter Args[] A alert filter which will be applied. This filter can be empty:
filter {}
- this meansmatch-all
. This is a block, structure is documented below.- ignore
Original booleanActions If set to
true
, policy will ignore the original actions of the alert. Default:false
- ignore
Original booleanDetails If set to
true
, policy will ignore the original details of the alert. Default:false
- ignore
Original booleanResponders If set to
true
, policy will ignore the original responders of the alert. Default:false
- 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 alert policy
- policy
Description 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
, orP5
- responders
Alert
Policy Responder Args[] 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 totrue
, 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}}
- string[]
Tags to add to the alerts original tags value as a list of strings. If
ignore_original_responders
field is set totrue
, this will replace the original responders.- team
Id string Id of team that this policy belongs to.
- time
Restrictions AlertPolicy Time Restriction Args[] 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 totrue
, 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[Alert
Policy Filter Args] A alert filter which will be applied. This filter can be empty:
filter {}
- this meansmatch-all
. This is a block, structure is documented below.- ignore_
original_ boolactions If set to
true
, policy will ignore the original actions of the alert. Default:false
- ignore_
original_ booldetails If set to
true
, policy will ignore the original details of the alert. Default:false
- ignore_
original_ boolresponders If set to
true
, policy will ignore the original responders of the alert. Default:false
- 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 alert policy
- 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
, orP5
- responders
Sequence[Alert
Policy Responder Args] 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 totrue
, 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}}
- Sequence[str]
Tags to add to the alerts original tags value as a list of strings. If
ignore_original_responders
field is set totrue
, this will replace the original responders.- team_
id str Id of team that this policy belongs to.
- time_
restrictions Sequence[AlertPolicy Time Restriction Args] 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 totrue
, this will replace the original actions.- alert
Description 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}}
- continue
Policy 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 meansmatch-all
. This is a block, structure is documented below.- ignore
Original BooleanActions If set to
true
, policy will ignore the original actions of the alert. Default:false
- ignore
Original BooleanDetails If set to
true
, policy will ignore the original details of the alert. Default:false
- ignore
Original BooleanResponders If set to
true
, policy will ignore the original responders of the alert. Default:false
- 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 alert policy
- policy
Description 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
, orP5
- 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 totrue
, 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}}
- List<String>
Tags to add to the alerts original tags value as a list of strings. If
ignore_original_responders
field is set totrue
, this will replace the original responders.- team
Id String Id of team that this policy belongs to.
- time
Restrictions 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<Alert
Policy Filter Condition> Conditions applied to filter. This is a block, structure is documented below.
- Type string
A filter type, supported types are:
match-all
,match-any-condition
,match-all-conditions
. Default:match-all
- Conditions
[]Alert
Policy Filter Condition Conditions applied to filter. This is a block, structure is documented below.
- Type string
A filter type, supported types are:
match-all
,match-any-condition
,match-all-conditions
. Default:match-all
- conditions
List<Alert
Policy Filter Condition> Conditions applied to filter. This is a block, structure is documented below.
- type String
A filter type, supported types are:
match-all
,match-any-condition
,match-all-conditions
. Default:match-all
- conditions
Alert
Policy Filter Condition[] Conditions applied to filter. This is a block, structure is documented below.
- type string
A filter type, supported types are:
match-all
,match-any-condition
,match-all-conditions
. Default:match-all
- conditions
Sequence[Alert
Policy Filter Condition] Conditions applied to filter. This is a block, structure is documented below.
- type str
A filter type, supported types are:
match-all
,match-any-condition
,match-all-conditions
. Default:match-all
- conditions List<Property Map>
Conditions applied to filter. This is a block, structure is documented below.
- type String
A filter type, supported types are:
match-all
,match-any-condition
,match-all-conditions
. Default:match-all
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
,responders
,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
.- Expected
Value 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
,responders
,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
.- Expected
Value 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
,responders
,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
.- expected
Value 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
,responders
,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
.- expected
Value 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
,responders
,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
,responders
,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
.- expected
Value 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
AlertPolicyTimeRestriction
- Type string
Defines if restriction should apply daily on given hours or on certain days and hours. Possible values are:
time-of-day
,weekday-and-time-of-day
- Restriction
List<Alert
Policy Time Restriction Restriction> 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 List<AlertPolicy Time Restriction Restriction List> List of days and hours definitions for field type =
weekday-and-time-of-day
. This is a block, structure is documented below.
- Type string
Defines if restriction should apply daily on given hours or on certain days and hours. Possible values are:
time-of-day
,weekday-and-time-of-day
- Restriction
[]Alert
Policy Time Restriction Restriction 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 []AlertPolicy Time Restriction Restriction List List of days and hours definitions for field type =
weekday-and-time-of-day
. This is a block, structure is documented below.
- type String
Defines if restriction should apply daily on given hours or on certain days and hours. Possible values are:
time-of-day
,weekday-and-time-of-day
- restriction
List<Alert
Policy Time Restriction Restriction> 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 List<AlertPolicy Time Restriction Restriction List> List of days and hours definitions for field type =
weekday-and-time-of-day
. This is a block, structure is documented below.
- type string
Defines if restriction should apply daily on given hours or on certain days and hours. Possible values are:
time-of-day
,weekday-and-time-of-day
- restriction
Alert
Policy Time Restriction Restriction[] 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 AlertPolicy Time Restriction Restriction List[] List of days and hours definitions for field type =
weekday-and-time-of-day
. This is a block, structure is documented below.
- type str
Defines if restriction should apply daily on given hours or on certain days and hours. Possible values are:
time-of-day
,weekday-and-time-of-day
- restriction
Sequence[Alert
Policy Time Restriction Restriction] 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[AlertPolicy Time Restriction Restriction List] List of days and hours definitions for field type =
weekday-and-time-of-day
. This is a block, structure is documented below.
- type String
Defines if restriction should apply daily on given hours or on certain days and hours. Possible values are:
time-of-day
,weekday-and-time-of-day
- 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.- restriction
List 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
- 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
AlertPolicyTimeRestrictionRestrictionList
- End
Day string Ending day of restriction (eg.
wednesday
)- End
Hour int Ending hour of restriction on defined
end_day
- End
Min int Ending minute of restriction on defined
end_hour
- Start
Day string Starting day of restriction (eg.
monday
)- Start
Hour int Starting hour of restriction on defined
start_day
- Start
Min int Staring minute of restriction on defined
start_hour
- End
Day string Ending day of restriction (eg.
wednesday
)- End
Hour int Ending hour of restriction on defined
end_day
- End
Min int Ending minute of restriction on defined
end_hour
- Start
Day string Starting day of restriction (eg.
monday
)- Start
Hour int Starting hour of restriction on defined
start_day
- Start
Min int Staring minute of restriction on defined
start_hour
- end
Day String Ending day of restriction (eg.
wednesday
)- end
Hour Integer Ending hour of restriction on defined
end_day
- end
Min Integer Ending minute of restriction on defined
end_hour
- start
Day String Starting day of restriction (eg.
monday
)- start
Hour Integer Starting hour of restriction on defined
start_day
- start
Min Integer Staring minute of restriction on defined
start_hour
- end
Day string Ending day of restriction (eg.
wednesday
)- end
Hour number Ending hour of restriction on defined
end_day
- end
Min number Ending minute of restriction on defined
end_hour
- start
Day string Starting day of restriction (eg.
monday
)- start
Hour number Starting hour of restriction on defined
start_day
- start
Min 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 on defined
end_day
- 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 on defined
start_day
- start_
min int Staring minute of restriction on defined
start_hour
- end
Day String Ending day of restriction (eg.
wednesday
)- end
Hour Number Ending hour of restriction on defined
end_day
- end
Min Number Ending minute of restriction on defined
end_hour
- start
Day String Starting day of restriction (eg.
monday
)- start
Hour Number Starting hour of restriction on defined
start_day
- start
Min 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
- Opsgenie pulumi/pulumi-opsgenie
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
opsgenie
Terraform Provider.