terraform-provider-opsgenie
terraform-provider-opsgenie copied to clipboard
opsgenie_escalation `repeat` property is not being imported properly to state
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
- Create an escalation in OpsGenie UI with a
repeatproperty - Import that escalation into Terraform
- Run
terraform plan - The output will have an empty
repeatsection
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.