Skip to content

terraform import does not import custom properties(extra-properties) attribute for opsgenie_alert_policy and If I apply by terraform any changes in the policy the extra-properties are deleted #456

@cecalero

Description

@cecalero

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" "test" {
  name                 = "test"
  message              = "{{message}}"
  alert_description    = "{{description}}"
  policy_description   = "This policy allows us to create Jira tickets automatically"
  ignore_original_tags = true
  enabled              = false
  tags                 = toset(keys(merge(var.common_tags, var.P2)))
  team_id              = opsgenie_team.id
  alias                = "{{alias}}"
  filter {
    type = "match-all-conditions"
    conditions {
      expected_value = ".*(DynamoDB|SQS).*"
      field          = "message"
      not            = false
      operation      = "matches"
      order          = 2
    }
conditions {
      expected_value = "P3"
      field          = "priority"
      not            = false
      operation      = "equals"
      order          = 1
    }
  }
}

Expected Behavior

We need to include the custom properties to generate tickets in Jira. When we import the policy we don't have this information and if I include it, terraform failed. Example

  extra_properties = {
    "Impact": "Medium",
    "Urgency": "Medium",
    "Component/s": "infrastructure",
    "Phase": "Operations",
  }

Response: An argument named "extra_properties" is not expected here.

Steps to Reproduce

Please list the steps required to reproduce the issue, for example,
terraform import . Make sure the alert policy in OG is set as a priority. Example:

Screenshot 2024-10-31 at 08 42 41

If I apply by terraform any changes in the policy the extra-properties are deleted.

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