terraform-provider-opsgenie icon indicating copy to clipboard operation
terraform-provider-opsgenie copied to clipboard

opsgenie_escalation `repeat` property is not being imported properly to state

Open aduric opened this issue 5 years ago • 1 comments

Terraform Version

0.12.24

Affected Resource(s)

  • opsgenie_escalation

When importing the opsgenie_escalation resource, the repeat property does not get imported correctly. The escalation has a repeat clause in OpsGenie but when imported into state the property is empty:

    {
      "mode": "managed",
      "type": "opsgenie_escalation",
      "name": "business_hours",
      "provider": "provider.opsgenie",
      "instances": [
        {
          "schema_version": 0,
          "attributes": {
            "description": "",
            "id": "<GUID>",
            "name": "Business Hours Escalation",
            "owner_team_id": "<GUID>",
            "repeat": [],
            "rules": [
              {
                "condition": "if-not-acked",
                "delay": 0,
                "notify_type": "admins",
                "recipient": [
                  {
                    "id": "<GUID>",
                    "type": "team"
                  }
                ]
              },
              {
                "condition": "if-not-acked",
                "delay": 0,
                "notify_type": "default",
                "recipient": [
                  {
                    "id": "<GUID>",
                    "type": "team"
                  }
                ]
              }
            ]
          }
        }
      ]
    }

Expected Behavior

The repeat property should contain the same key-values as in OpsGenie.

Actual Behavior

The repeat property is empty in the state file, causing a subsequent plan to want to create that property.

Steps to Reproduce

  1. Create an escalation in OpsGenie UI with a repeat property
  2. Import that escalation into Terraform
  3. Run terraform plan
  4. The output will have an empty repeat section

aduric avatar Jul 08 '20 17:07 aduric

Surprisingly enough, now after almost two years since the issue was initially reported it still exists. And we have no idea on how to adjust our code to avoid it.

michael-elumeev avatar Aug 26 '22 11:08 michael-elumeev