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:
# avi_healthmonitor.healthcheck-tcp-test will be updated in-place
~ resource "avi_healthmonitor" "healthcheck-tcp-test" {
+ failed_checks = "2"
id = "https://xyz"
+ is_federated = "false"
name = "healthcheck-tcp-test"
+ receive_timeout = "4"
+ send_interval = "10"
+ successful_checks = "2"
# (4 unchanged attributes hidden)
+ tcp_monitor {
+ maintenance_response = (known after apply)
+ tcp_half_open = "false"
+ tcp_request = (known after apply)
+ tcp_response = (known after apply)
}
}
Plan: 0 to add, 1 to change, 0 to destroy.
Running a terraform plan shows that the resource is going to make changes to the resource, even though the resource is already imported and has the correct values.
Resource values in state after a import:
terraform state show avi_healthmonitor.healthcheck-tcp-test
# avi_healthmonitor.healthcheck-tcp-test:
resource "avi_healthmonitor" "healthcheck-tcp-test" {
id = [https://xyz]
monitor_port = "443"
name = "healthcheck-tcp-test"
tenant_ref = [https://xyz]
type = "HEALTH_MONITOR_TCP"
uuid = "healthmonitor-e3f60d20"
}
The avi provider is reading and importing the resource with a minimal set of attributes.
Reproduction steps
import resource from avi - health monitor in this case
check values of imported resource
...
Expected behavior
Import all the existing values that are set in the health monitor. Terraform plan should not attempt to set the values if the values are already in the resource.
Along the same vein, avi_healthmonitor (in v22.1.6 and 30.2.1) is recreating the protocol based monitor blocks on every apply, not simply the first after an import.
Describe the bug
I have imported an existing resource
tf code for said resource:
Import successful!
Now run a terraform plan
Running a terraform plan shows that the resource is going to make changes to the resource, even though the resource is already imported and has the correct values.
Resource values in state after a import:
terraform state show avi_healthmonitor.healthcheck-tcp-test
The avi provider is reading and importing the resource with a minimal set of attributes.
Reproduction steps
Expected behavior
Import all the existing values that are set in the health monitor. Terraform plan should not attempt to set the values if the values are already in the resource.
Additional context
No response