Skip to content

terraform import does not import priority attribute for opsgenie_alert_policy #453

@dennydang2

Description

@dennydang2

Hi there,

Thank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.

Terraform Version

1.9.7

Affected Resource(s)

Please list the resources as a list, for example:

  • opsgenie_alert_policy

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

Terraform Configuration Files

resource "opsgenie_alert_policy" "downgrade_fedramp" {
    actions                    = []
    alert_description          = "{{description}}"
    alias                      = "{{alias}}"
    continue_policy            = true
    enabled                    = true
    entity                     = "{{entity}}"
    ignore_original_actions    = false
    ignore_original_details    = false
    ignore_original_responders = false
    ignore_original_tags       = false
    message                    = "{{message}}"
    name                       = "Downgrade FEDRAMP P2 alarms to P3"
    source                     = "{{source}}"
    tags                       = [
        "priority downgrade",
    ]
    team_id                    = var.team_id

    filter {
        type = "match-any-condition"

        conditions {
            expected_value = "environment:stg-apse"
            field          = "tags"
            not            = false
            operation      = "contains"
            order          = 1
        }
        conditions {
            expected_value = "fedramp"
            field          = "tags"
            not            = false
            operation      = "contains"
            order          = 0
        }
    }
}

Expected Behavior

What should have happened?
When running terraform import on an opsgenie_alert_policy resource, it should import all of its attributes including the priority.

Actual Behavior

When running terraform import on an opsgenie_alert_policy resource, it does not import the priority and leaves it as null.

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform import <RESOURCE CONFIG PATH> <RESOURCE ID>. Make sure the alert policy in OG has a priority set. Example:
    image

  2. terraform state show <RESOURCE CONFIG PATH>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions