1. Packages
  2. Opsgenie
  3. API Docs
  4. Escalation
Opsgenie v1.2.9 published on Thursday, Jul 27, 2023 by Pulumi

opsgenie.Escalation

Explore with Pulumi AI

opsgenie logo
Opsgenie v1.2.9 published on Thursday, Jul 27, 2023 by Pulumi

    Manages an Escalation within Opsgenie.

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Opsgenie = Pulumi.Opsgenie;
    
    return await Deployment.RunAsync(() => 
    {
        var test = new Opsgenie.Escalation("test", new()
        {
            Description = "test",
            OwnerTeamId = opsgenie_team.Test.Id,
            Repeats = new[]
            {
                new Opsgenie.Inputs.EscalationRepeatArgs
                {
                    CloseAlertAfterAll = false,
                    Count = 1,
                    ResetRecipientStates = true,
                    WaitInterval = 10,
                },
            },
            Rules = new[]
            {
                new Opsgenie.Inputs.EscalationRuleArgs
                {
                    Condition = "if-not-acked",
                    Delay = 1,
                    NotifyType = "default",
                    Recipients = new[]
                    {
                        new Opsgenie.Inputs.EscalationRuleRecipientArgs
                        {
                            Id = opsgenie_user.Test.Id,
                            Type = "user",
                        },
                        new Opsgenie.Inputs.EscalationRuleRecipientArgs
                        {
                            Id = opsgenie_team.Test.Id,
                            Type = "team",
                        },
                        new Opsgenie.Inputs.EscalationRuleRecipientArgs
                        {
                            Id = opsgenie_schedule.Test.Id,
                            Type = "schedule",
                        },
                    },
                },
            },
        });
    
    });
    
    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 {
    		_, err := opsgenie.NewEscalation(ctx, "test", &opsgenie.EscalationArgs{
    			Description: pulumi.String("test"),
    			OwnerTeamId: pulumi.Any(opsgenie_team.Test.Id),
    			Repeats: opsgenie.EscalationRepeatArray{
    				&opsgenie.EscalationRepeatArgs{
    					CloseAlertAfterAll:   pulumi.Bool(false),
    					Count:                pulumi.Int(1),
    					ResetRecipientStates: pulumi.Bool(true),
    					WaitInterval:         pulumi.Int(10),
    				},
    			},
    			Rules: opsgenie.EscalationRuleArray{
    				&opsgenie.EscalationRuleArgs{
    					Condition:  pulumi.String("if-not-acked"),
    					Delay:      pulumi.Int(1),
    					NotifyType: pulumi.String("default"),
    					Recipients: opsgenie.EscalationRuleRecipientArray{
    						&opsgenie.EscalationRuleRecipientArgs{
    							Id:   pulumi.Any(opsgenie_user.Test.Id),
    							Type: pulumi.String("user"),
    						},
    						&opsgenie.EscalationRuleRecipientArgs{
    							Id:   pulumi.Any(opsgenie_team.Test.Id),
    							Type: pulumi.String("team"),
    						},
    						&opsgenie.EscalationRuleRecipientArgs{
    							Id:   pulumi.Any(opsgenie_schedule.Test.Id),
    							Type: pulumi.String("schedule"),
    						},
    					},
    				},
    			},
    		})
    		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.Escalation;
    import com.pulumi.opsgenie.EscalationArgs;
    import com.pulumi.opsgenie.inputs.EscalationRepeatArgs;
    import com.pulumi.opsgenie.inputs.EscalationRuleArgs;
    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 test = new Escalation("test", EscalationArgs.builder()        
                .description("test")
                .ownerTeamId(opsgenie_team.test().id())
                .repeats(EscalationRepeatArgs.builder()
                    .closeAlertAfterAll(false)
                    .count(1)
                    .resetRecipientStates(true)
                    .waitInterval(10)
                    .build())
                .rules(EscalationRuleArgs.builder()
                    .condition("if-not-acked")
                    .delay(1)
                    .notifyType("default")
                    .recipients(                
                        EscalationRuleRecipientArgs.builder()
                            .id(opsgenie_user.test().id())
                            .type("user")
                            .build(),
                        EscalationRuleRecipientArgs.builder()
                            .id(opsgenie_team.test().id())
                            .type("team")
                            .build(),
                        EscalationRuleRecipientArgs.builder()
                            .id(opsgenie_schedule.test().id())
                            .type("schedule")
                            .build())
                    .build())
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_opsgenie as opsgenie
    
    test = opsgenie.Escalation("test",
        description="test",
        owner_team_id=opsgenie_team["test"]["id"],
        repeats=[opsgenie.EscalationRepeatArgs(
            close_alert_after_all=False,
            count=1,
            reset_recipient_states=True,
            wait_interval=10,
        )],
        rules=[opsgenie.EscalationRuleArgs(
            condition="if-not-acked",
            delay=1,
            notify_type="default",
            recipients=[
                opsgenie.EscalationRuleRecipientArgs(
                    id=opsgenie_user["test"]["id"],
                    type="user",
                ),
                opsgenie.EscalationRuleRecipientArgs(
                    id=opsgenie_team["test"]["id"],
                    type="team",
                ),
                opsgenie.EscalationRuleRecipientArgs(
                    id=opsgenie_schedule["test"]["id"],
                    type="schedule",
                ),
            ],
        )])
    
    import * as pulumi from "@pulumi/pulumi";
    import * as opsgenie from "@pulumi/opsgenie";
    
    const test = new opsgenie.Escalation("test", {
        description: "test",
        ownerTeamId: opsgenie_team.test.id,
        repeats: [{
            closeAlertAfterAll: false,
            count: 1,
            resetRecipientStates: true,
            waitInterval: 10,
        }],
        rules: [{
            condition: "if-not-acked",
            delay: 1,
            notifyType: "default",
            recipients: [
                {
                    id: opsgenie_user.test.id,
                    type: "user",
                },
                {
                    id: opsgenie_team.test.id,
                    type: "team",
                },
                {
                    id: opsgenie_schedule.test.id,
                    type: "schedule",
                },
            ],
        }],
    });
    
    resources:
      test:
        type: opsgenie:Escalation
        properties:
          description: test
          ownerTeamId: ${opsgenie_team.test.id}
          repeats:
            - closeAlertAfterAll: false
              count: 1
              resetRecipientStates: true
              waitInterval: 10
          rules:
            - condition: if-not-acked
              delay: 1
              notifyType: default
              recipients:
                - id: ${opsgenie_user.test.id}
                  type: user
                - id: ${opsgenie_team.test.id}
                  type: team
                - id: ${opsgenie_schedule.test.id}
                  type: schedule
    

    Create Escalation Resource

    new Escalation(name: string, args: EscalationArgs, opts?: CustomResourceOptions);
    @overload
    def Escalation(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   description: Optional[str] = None,
                   name: Optional[str] = None,
                   owner_team_id: Optional[str] = None,
                   repeats: Optional[Sequence[EscalationRepeatArgs]] = None,
                   rules: Optional[Sequence[EscalationRuleArgs]] = None)
    @overload
    def Escalation(resource_name: str,
                   args: EscalationArgs,
                   opts: Optional[ResourceOptions] = None)
    func NewEscalation(ctx *Context, name string, args EscalationArgs, opts ...ResourceOption) (*Escalation, error)
    public Escalation(string name, EscalationArgs args, CustomResourceOptions? opts = null)
    public Escalation(String name, EscalationArgs args)
    public Escalation(String name, EscalationArgs args, CustomResourceOptions options)
    
    type: opsgenie:Escalation
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args EscalationArgs
    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 EscalationArgs
    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 EscalationArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args EscalationArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args EscalationArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Escalation 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 Escalation resource accepts the following input properties:

    Rules List<EscalationRule>

    List of the escalation rules.

    Description string

    Description of the escalation.

    Name string

    Name of the escalation.

    OwnerTeamId string

    Owner team id of the escalation.

    Repeats List<EscalationRepeat>

    Repeat preferences of the escalation including repeat interval, count, reverting acknowledge and seen states back and closing an alert automatically as soon as repeats are completed

    Rules []EscalationRuleArgs

    List of the escalation rules.

    Description string

    Description of the escalation.

    Name string

    Name of the escalation.

    OwnerTeamId string

    Owner team id of the escalation.

    Repeats []EscalationRepeatArgs

    Repeat preferences of the escalation including repeat interval, count, reverting acknowledge and seen states back and closing an alert automatically as soon as repeats are completed

    rules List<EscalationRule>

    List of the escalation rules.

    description String

    Description of the escalation.

    name String

    Name of the escalation.

    ownerTeamId String

    Owner team id of the escalation.

    repeats List<EscalationRepeat>

    Repeat preferences of the escalation including repeat interval, count, reverting acknowledge and seen states back and closing an alert automatically as soon as repeats are completed

    rules EscalationRule[]

    List of the escalation rules.

    description string

    Description of the escalation.

    name string

    Name of the escalation.

    ownerTeamId string

    Owner team id of the escalation.

    repeats EscalationRepeat[]

    Repeat preferences of the escalation including repeat interval, count, reverting acknowledge and seen states back and closing an alert automatically as soon as repeats are completed

    rules Sequence[EscalationRuleArgs]

    List of the escalation rules.

    description str

    Description of the escalation.

    name str

    Name of the escalation.

    owner_team_id str

    Owner team id of the escalation.

    repeats Sequence[EscalationRepeatArgs]

    Repeat preferences of the escalation including repeat interval, count, reverting acknowledge and seen states back and closing an alert automatically as soon as repeats are completed

    rules List<Property Map>

    List of the escalation rules.

    description String

    Description of the escalation.

    name String

    Name of the escalation.

    ownerTeamId String

    Owner team id of the escalation.

    repeats List<Property Map>

    Repeat preferences of the escalation including repeat interval, count, reverting acknowledge and seen states back and closing an alert automatically as soon as repeats are completed

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Escalation 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 Escalation Resource

    Get an existing Escalation 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?: EscalationState, opts?: CustomResourceOptions): Escalation
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            description: Optional[str] = None,
            name: Optional[str] = None,
            owner_team_id: Optional[str] = None,
            repeats: Optional[Sequence[EscalationRepeatArgs]] = None,
            rules: Optional[Sequence[EscalationRuleArgs]] = None) -> Escalation
    func GetEscalation(ctx *Context, name string, id IDInput, state *EscalationState, opts ...ResourceOption) (*Escalation, error)
    public static Escalation Get(string name, Input<string> id, EscalationState? state, CustomResourceOptions? opts = null)
    public static Escalation get(String name, Output<String> id, EscalationState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Description string

    Description of the escalation.

    Name string

    Name of the escalation.

    OwnerTeamId string

    Owner team id of the escalation.

    Repeats List<EscalationRepeat>

    Repeat preferences of the escalation including repeat interval, count, reverting acknowledge and seen states back and closing an alert automatically as soon as repeats are completed

    Rules List<EscalationRule>

    List of the escalation rules.

    Description string

    Description of the escalation.

    Name string

    Name of the escalation.

    OwnerTeamId string

    Owner team id of the escalation.

    Repeats []EscalationRepeatArgs

    Repeat preferences of the escalation including repeat interval, count, reverting acknowledge and seen states back and closing an alert automatically as soon as repeats are completed

    Rules []EscalationRuleArgs

    List of the escalation rules.

    description String

    Description of the escalation.

    name String

    Name of the escalation.

    ownerTeamId String

    Owner team id of the escalation.

    repeats List<EscalationRepeat>

    Repeat preferences of the escalation including repeat interval, count, reverting acknowledge and seen states back and closing an alert automatically as soon as repeats are completed

    rules List<EscalationRule>

    List of the escalation rules.

    description string

    Description of the escalation.

    name string

    Name of the escalation.

    ownerTeamId string

    Owner team id of the escalation.

    repeats EscalationRepeat[]

    Repeat preferences of the escalation including repeat interval, count, reverting acknowledge and seen states back and closing an alert automatically as soon as repeats are completed

    rules EscalationRule[]

    List of the escalation rules.

    description str

    Description of the escalation.

    name str

    Name of the escalation.

    owner_team_id str

    Owner team id of the escalation.

    repeats Sequence[EscalationRepeatArgs]

    Repeat preferences of the escalation including repeat interval, count, reverting acknowledge and seen states back and closing an alert automatically as soon as repeats are completed

    rules Sequence[EscalationRuleArgs]

    List of the escalation rules.

    description String

    Description of the escalation.

    name String

    Name of the escalation.

    ownerTeamId String

    Owner team id of the escalation.

    repeats List<Property Map>

    Repeat preferences of the escalation including repeat interval, count, reverting acknowledge and seen states back and closing an alert automatically as soon as repeats are completed

    rules List<Property Map>

    List of the escalation rules.

    Supporting Types

    EscalationRepeat, EscalationRepeatArgs

    EscalationRule, EscalationRuleArgs

    Condition string

    The condition for notifying the recipient of escalation rule that is based on the alert state. Possible values are: if-not-acked and if-not-closed. Default: if-not-acked

    Delay int

    Time delay of the escalation rule, in minutes.

    NotifyType string

    Recipient calculation logic for schedules. Possible values are:

    Recipients List<EscalationRuleRecipient>

    Object of schedule, team, or users which will be notified in escalation. The possible values for participants are: user, schedule, team.

    Condition string

    The condition for notifying the recipient of escalation rule that is based on the alert state. Possible values are: if-not-acked and if-not-closed. Default: if-not-acked

    Delay int

    Time delay of the escalation rule, in minutes.

    NotifyType string

    Recipient calculation logic for schedules. Possible values are:

    Recipients []EscalationRuleRecipient

    Object of schedule, team, or users which will be notified in escalation. The possible values for participants are: user, schedule, team.

    condition String

    The condition for notifying the recipient of escalation rule that is based on the alert state. Possible values are: if-not-acked and if-not-closed. Default: if-not-acked

    delay Integer

    Time delay of the escalation rule, in minutes.

    notifyType String

    Recipient calculation logic for schedules. Possible values are:

    recipients List<EscalationRuleRecipient>

    Object of schedule, team, or users which will be notified in escalation. The possible values for participants are: user, schedule, team.

    condition string

    The condition for notifying the recipient of escalation rule that is based on the alert state. Possible values are: if-not-acked and if-not-closed. Default: if-not-acked

    delay number

    Time delay of the escalation rule, in minutes.

    notifyType string

    Recipient calculation logic for schedules. Possible values are:

    recipients EscalationRuleRecipient[]

    Object of schedule, team, or users which will be notified in escalation. The possible values for participants are: user, schedule, team.

    condition str

    The condition for notifying the recipient of escalation rule that is based on the alert state. Possible values are: if-not-acked and if-not-closed. Default: if-not-acked

    delay int

    Time delay of the escalation rule, in minutes.

    notify_type str

    Recipient calculation logic for schedules. Possible values are:

    recipients Sequence[EscalationRuleRecipient]

    Object of schedule, team, or users which will be notified in escalation. The possible values for participants are: user, schedule, team.

    condition String

    The condition for notifying the recipient of escalation rule that is based on the alert state. Possible values are: if-not-acked and if-not-closed. Default: if-not-acked

    delay Number

    Time delay of the escalation rule, in minutes.

    notifyType String

    Recipient calculation logic for schedules. Possible values are:

    recipients List<Property Map>

    Object of schedule, team, or users which will be notified in escalation. The possible values for participants are: user, schedule, team.

    EscalationRuleRecipient, EscalationRuleRecipientArgs

    Id string

    The ID of the Opsgenie Escalation.

    Type string
    Id string

    The ID of the Opsgenie Escalation.

    Type string
    id String

    The ID of the Opsgenie Escalation.

    type String
    id string

    The ID of the Opsgenie Escalation.

    type string
    id str

    The ID of the Opsgenie Escalation.

    type str
    id String

    The ID of the Opsgenie Escalation.

    type String

    Import

    Escalations can be imported using the escalation_id, e.g.

     $ pulumi import opsgenie:index/escalation:Escalation test escalation_id`
    

    Package Details

    Repository
    Opsgenie pulumi/pulumi-opsgenie
    License
    Apache-2.0
    Notes

    This Pulumi package is based on the opsgenie Terraform Provider.

    opsgenie logo
    Opsgenie v1.2.9 published on Thursday, Jul 27, 2023 by Pulumi