OpenNebula / terraform-provider-opennebula

Terraform provider for OpenNebula
https://www.terraform.io/docs/providers/opennebula/
Mozilla Public License 2.0
63 stars 52 forks source link

Security group update not being applied #452

Closed maartendq closed 1 year ago

maartendq commented 1 year ago

Description

When adding new rules to a security group (tried existing security group in state + newly created ones), the new rule does not get really applied. Terraform apply says the change is applied fine, but the rule is not added in ONE (+ consecutive plan gives the change again). terraform provider: v1.2.1 Opennebula: 6.4.3

Terraform and Provider version

v1.3.3

Affected resources and data sources

opennebula_security_group resource

Terraform configuration

resource "opennebula_security_group" "sg" {
   name        = local.name
   group       = local.group
   permissions = var.permissions
   dynamic "rule" {
     for_each = var.rules
     content {
       protocol   = rule.value.protocol
       rule_type  = rule.value.type
       range      = rule.value.ports
       ip         = rule.value.ip
       size       = rule.value.size
       network_id = rule.value.network_id
     }
   }
   tags = {
     environment = var.environment
     platform    = var.platform
   }
 }

Expected behavior

After the security groups (is successfully) created, we try to add a new rule in tfvars and would expect to see it in ONE

Actual behavior

The security group in ONE is not updated with the new rule (even though the apply is finished successfully). Consecutive plan shows the change again.

Steps to Reproduce

Create security group -> add new rule -> rule does not get added

Debug output

No response

Panic output

No response

Important factoids

If I'm not mistaken this behaviour got introduced when switching from provider version 1.1.0 to 1.2.0

References

No response

treywelsh commented 1 year ago

introduced by me from 0.5.0 release via #275