terraform-provider-bigip
terraform-provider-bigip copied to clipboard
persistence_profiles changes are not handled correctly on import
trafficstars
Environment
- TMOS/Bigip Version: BIG-IP 15.1.8.1
- Terraform Version: v1.5.6
- Terraform bigip provider Version: v1.22.1
Summary
When importing a bigip_ltm_virtual_server resource, persistence_profiles are not handled correctly.
Steps To Reproduce
Steps to reproduce the behavior:
-
Create a virtual server in the UI, with a persistence profile set
-
Create terraform config for above virtual server (with a change, BUT without
persistence_profilesset)
# bigip_ltm_virtual_server.virtual_server:
resource "bigip_ltm_virtual_server" "virtual_server" {
id = "/my-partition/vip-major-admin-443"
name = "/my-partition/vip-major-admin-443"
description = "VIP MAJOR admin-443 (managed by terraform)"
destination = "1.1.1.1%1000"
mask = "255.255.255.255"
ip_protocol = "tcp"
port = 443
pool = "/my-partition/pool-major-admin-2443"
profiles = [
"/Common/tcp",
]
snatpool = "/my-partition/sn-112"
source_address_translation = "snat"
}
- import the resource
$ terraform import 'bigip_ltm_virtual_server.virtual_server' /my-partition/vip-major-admin-443
bigip_ltm_virtual_server.virtual_server: Importing from ID "/my-partition/vip-major-admin-443"...
bigip_ltm_virtual_server.virtual_server: Import prepared!
Prepared bigip_ltm_virtual_server for import
bigip_ltm_virtual_server.virtual_server: Refreshing state... [id=/my-partition/vip-major-admin-443]
Import successful!
The resources that were imported are shown above. These resources are now in
your Terraform state and will henceforth be managed by Terraform.
- check terraform plan output
$ terraform plan
bigip_ltm_virtual_server.virtual_server: Refreshing state... [id=/my-partition/vip-major-admin-443]
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the
following symbols:
~ update in-place
Terraform will perform the following actions:
# bigip_ltm_virtual_server.virtual_server will be updated in-place
~ resource "bigip_ltm_virtual_server" "virtual_server" {
~ description = "some description" -> "VIP MAJOR admin-443 (managed by terraform)"
id = "/my-partition/vip-demo-admin-443"
name = "/my-partition/vip-demo-admin-443"
# (18 unchanged attributes hidden)
}
Plan: 0 to add, 1 to change, 0 to destroy.
- terraform apply removes the persistence profile
Expected Behavior
persistence_profiles should show in the changes
Actual Behavior
persistence_profiles is not shown in the changes