Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

terraform import does not import priority attribute for opsgenie_alert_policy #453

Open
dennydang2 opened this issue Oct 8, 2024 · 0 comments

Comments

@dennydang2
Copy link

dennydang2 commented Oct 8, 2024

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>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant