opsgenie / terraform-provider-opsgenie

Terraform OpsGenie provider
https://registry.terraform.io/providers/opsgenie/opsgenie/latest/docs
Mozilla Public License 2.0
104 stars 137 forks source link

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

Open aduric opened 4 years ago

aduric commented 4 years ago

Terraform Version

0.12.24

Affected Resource(s)

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
michael-elumeev commented 2 years ago

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.