opentelekomcloud / terraform-provider-opentelekomcloud

Terraform OpenTelekomCloud provider
https://registry.terraform.io/providers/opentelekomcloud/opentelekomcloud/latest
Mozilla Public License 2.0
87 stars 77 forks source link

opentelekomcloud_networking_secgroup_rule_v2 does not detect port/protocol change #2338

Closed niklasweimann closed 1 year ago

niklasweimann commented 1 year ago

Terraform provider version

Terraform v1.5.7

Affected Resource(s)

Terraform Configuration Files

resource "opentelekomcloud_networking_secgroup_rule_v2" "all_zabbix_zabbix" {
  direction         = "ingress"
  ethertype         = "IPv4"
  protocol          = "tcp"
  port_range_min    = 10050
  port_range_max    = 10050
  remote_group_id   = opentelekomcloud_networking_secgroup_v2.zabbix.id
  security_group_id = opentelekomcloud_networking_secgroup_v2.zabbix.id
}

after first apply

resource "opentelekomcloud_networking_secgroup_rule_v2" "all_zabbix_zabbix" {
  direction         = "ingress"
  ethertype         = "IPv4"
  remote_group_id   = opentelekomcloud_networking_secgroup_v2.zabbix.id
  security_group_id = opentelekomcloud_networking_secgroup_v2.zabbix.id
}

Debug Output/Panic Output

[...]
{"@level":"info","@message":"opentelekomcloud_networking_secgroup_rule_v2.all_zabbix_zabbix: Refreshing state... [id=73a9f59f-e738-4110-b03a-8bed78d882d7]","@module":"terraform.ui","@timestamp":"2023-10-10T14:13:06.686214Z","hook":{"resource":{"addr":"opentelekomcloud_networking_secgroup_rule_v2.all_zabbix_zabbix","module":"","resource":"opentelekomcloud_networking_secgroup_rule_v2.all_zabbix_zabbix","implied_provider":"opentelekomcloud","resource_type":"opentelekomcloud_networking_secgroup_rule_v2","resource_name":"all_zabbix_zabbix","resource_key":null},"id_key":"id","id_value":"73a9f59f-e738-4110-b03a-8bed78d882d7"},"type":"refresh_start"}
[...]
{"@level":"info","@message":"opentelekomcloud_networking_secgroup_rule_v2.all_zabbix_zabbix: Refresh complete [id=73a9f59f-e738-4110-b03a-8bed78d882d7]","@module":"terraform.ui","@timestamp":"2023-10-10T14:13:07.137866Z","hook":{"resource":{"addr":"opentelekomcloud_networking_secgroup_rule_v2.all_zabbix_zabbix","module":"","resource":"opentelekomcloud_networking_secgroup_rule_v2.all_zabbix_zabbix","implied_provider":"opentelekomcloud","resource_type":"opentelekomcloud_networking_secgroup_rule_v2","resource_name":"all_zabbix_zabbix","resource_key":null},"id_key":"id","id_value":"73a9f59f-e738-4110-b03a-8bed78d882d7"},"type":"refresh_complete"}
[...]

Steps to Reproduce

  1. terraform apply for first code block
  2. terraform apply for second code block => Terraform reports nothing to delete (even though the port and protocol were removed)

Expected Behavior

Terraform detects that the port and protocol were changed and allows to apply the change.

Actual Behavior

Terraform finished planning and did not find any changes.

Important Factoids

    opentelekomcloud = {
      source  = "opentelekomcloud/opentelekomcloud"
      version = "1.33.1"
    }

References

None

artem-lifshits commented 1 year ago

Please check latest release.

niklasweimann commented 1 year ago

I tested it with v1.35.10 and it worked fine. Thanks for the quick fix 👍