F5Networks / terraform-provider-bigip

Terraform resources that can configure F5 BIG-IP products
https://registry.terraform.io/providers/F5Networks/bigip/latest/docs
Mozilla Public License 2.0
103 stars 119 forks source link

Deleting iRules from Virtual Server Configs #923

Closed atyanh closed 7 months ago

atyanh commented 8 months ago

Environment

Summary

Terraform doesn't change iRule list in Virtual Server configurations when I leave the list empty. It works correctly if I leave at least one iRule but if we delete all and leave it the array empty it doesn't do anything.

Steps To Reproduce

Steps to reproduce the behavior:

For example irules = [ bigip_ltm_irule.rule1.name, bigip_ltm_irule.rule2.name ] This works correctly, but when I delete iRules it shows on the plan but doesn't do anything irules = [ ]

pgouband commented 8 months ago

Hi @atyanh,

I tested and it works uring: irules = [ "" ]

Could you test?

atyanh commented 8 months ago

Hi @atyanh,

I tested and it works uring: irules = [ "" ]

Could you test?

You are right it worked, thank you.

But now every time I execute terraform plan it shows that the rules will be updated.

  ~ resource "bigip_ltm_virtual_server" "test-proj_https" {
        id                         = "/Common/https-app-tf-12347"
      ~ irules                     = [
          + "",
        ]
        name                       = "/Common/https-app-tf-12347"
        # (19 unchanged attributes hidden)
    }

Is this okay? I think it will interfere with work when I provision some resources.

pgouband commented 8 months ago

Hi @atyanh,

You're right about the output of plan but you can avoid that removing the line "irules".

atyanh commented 8 months ago

Thank you for your answer, but I'm creating modules and should always pass a value for irules attribute.Can I find a way to do that?

pgouband commented 8 months ago

Hi @atyanh,

Can you create two modules? One with irules list and one without?

atyanh commented 8 months ago

Hi @atyanh,

Can you create two modules? One with irules list and one without?

Yes I can, but I don't think it's the best solution to duplicate 4 modules just for irules. I thought it would be easy to resolve and would like to help with developing the provider.Whatever thank you :)

pgouband commented 8 months ago

Hi,

Thanks for reporting. Added to the backlog and internal tracking ID for this request is: INFRAANO-1417.

atyanh commented 8 months ago

Okay Thank you

RavinderReddyF5 commented 7 months ago

fixed in v1.21.0