pagerduty_event_rule

NOTE: The pagerduty_event_rule resource has been deprecated in favor of the pagerduty_ruleset and pagerduty_ruleset_rule resources. Please use the ruleset based resources for working with Event Rules.

An event rule determines what happens to an event that is sent to PagerDuty by monitoring tools and other integrations.

Example Usage

resource "pagerduty_event_rule" "second" {
    action_json = jsonencode([
        [
            "route",
            "P5DTL0K"
        ],
        [
            "severity",
            "warning"
        ],
        [
            "annotate",
            "2 Managed by terraform"
        ],
        [
            "priority",
            "PL451DT"
        ]
    ])
    condition_json = jsonencode([
        "and",
        ["contains",["path","payload","source"],"website"],
        ["contains",["path","headers","from","0","address"],"homer"]
    ])
    advanced_condition_json = jsonencode([
        [
            "scheduled-weekly",
            1565392127032,
            3600000,
            "America/Los_Angeles",
            [
                1,
                2,
                3,
                5,
                7
            ]
        ]
    ])
}
resource "pagerduty_event_rule" "third" {
    action_json = jsonencode([
        [
            "route",
            "P5DTL0K"
        ],
        [
            "severity",
            "warning"
        ],
        [
            "annotate",
            "3 Managed by terraform"
        ],
        [
            "priority",
            "PL451DT"
        ]
    ])
    condition_json = jsonencode([
        "and",
        ["contains",["path","payload","source"],"website"],
        ["contains",["path","headers","from","0","address"],"homer"]
    ])
    depends_on = [pagerduty_event_rule.two]
}

Argument Reference

The following arguments are supported:

Attributes Reference

The following attributes are exported:

Import

Event rules can be imported using the id, e.g.

$ terraform import pagerduty_event_rule.main 19acac92-027a-4ea0-b06c-bbf516519601