-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Medium
-
Component/s: Integrations - 3rd-party - Terraform
-
None
-
Severity 2 - Major
Issue Summary
Customer reported facing a regression with the latest terraform provider for OpsGenie.
Customer has reported the issue on Github: https://github.com/opsgenie/terraform-provider-opsgenie/issues/412.
Plans will now continuously show a drift on resources that were not having issue before the provider upgrade.
Terraform Version
❯ terraform version Terraform v1.5.7 on darwin_amd64 + provider registry.terraform.io/hashicorp/aws v5.19.0 + provider registry.terraform.io/hashicorp/http v3.4.0 + provider registry.terraform.io/hashicorp/null v3.2.1 + provider registry.terraform.io/opsgenie/opsgenie v0.6.34
Affected Resource(s)
- opsgenie_team_routing_rule (possibly anything else using time_retriction)
Terraform Configuration Files
resource "opsgenie_team_routing_rule" "test" {
name = "test" order = 0 team_id = "xxx" timezone = "America/Los_Angeles"criteria
{ type = "match-all" }
notify
{ type = "none" }
}
Steps to Reproduce
- terraform apply
- terraform plan. This step will show a drift
Expected Results
No drift once applied
Actual Results
Perpetual drift on opsgenie_team_routing_rule without a time_restriction. E.g.
~ resource "opsgenie_team_routing_rule" "test" {
name = "test"
# (4 unchanged attributes hidden)
- time_restriction {
- restriction {
- end_hour = 0 -> null
- end_min = 0 -> null
- start_hour = 0 -> null
- start_min = 0 -> null
}
}
# (2 unchanged blocks hidden)
}
References
- Customer believes the issue was introduced in Refactor time_restriction and stabilise plans containing notification_rule.steps, notification_policy.filter.conditions and time_restrictions #404 around https://github.com/opsgenie/terraform-provider-opsgenie/blob/master/opsgenie/util.go#L120C11-L137. When there is no time restriction, this block adds a restriction with default value leading to the drift. Customer thinks it should have returned an empty map instead.
*Above copied/extracted from Github Issue #412
Workaround
Customer believes https://github.com/opsgenie/terraform-provider-opsgenie/pull/413 would fix it