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

bigip_command always shows command_result as a new field #610

Open braunsonm opened 2 years ago

braunsonm commented 2 years ago

Summary

When you create a bigip_command, it will succeed but whenever you run terraform apply again it will always show + command_result = (known after apply) causing the command to be modified everytime.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Create a bigip_command resource
  2. Run tf apply again
  3. Notice the change always appearing

Expected Behavior

The resource should have no changes detected

Actual Behavior

The resource pollutes the terraform plan

trinaths commented 2 years ago

@braunsonm Please share the exact TF manifest to try at our end.

braunsonm commented 2 years ago

@trinaths

resource "bigip_command" "create_partition" {
  commands = ["create auth partition ${var.partition_name} default-route-domain 0"]
  when = "apply"
}

This is a temporary workaround:

resource "bigip_command" "create_partition" {
  commands = ["create auth partition ${var.partition_name} default-route-domain 0"]
  when = "apply"

  lifecycle {
    ignore_changes = [command_result]
  }
}