When specifying tunnel_monitor_proxy_id for panos_ipsec_tunnel, the modification fails.
Expected behavior
The tunnel_monitor_proxy_id for panos_ipsec_tunnel should succeed.
Current behavior
When adding a tunnel_monitor_proxy_id to a panos_ipsec_tunnel the provider seems to recreate all of the associated panos_ipsec_tunnel_proxy_id_ipv4 objects, based on the resulting plan. This seems to cause a sequencing issue or race condition as the proxy-id doesn't seem to exist at the time it is being set on the panos_ipsec_tunnel.
Possible solution
Possibly do not flush the panos_ipsec_tunnel_proxy_id_ipv4 objects when adding a tunnel_monitor_proxy_id.
Steps to reproduce
The following data is from a redacted/example config and plan. This mirrors my sensitive configuration and output.
In the following plan, I am only adding tunnel_monitor_proxy_id. The panos_ipsec_tunnel_proxy_id_ipv4 objects already exist in state and on the device.
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
+ create
~ update in-place
Terraform will perform the following actions:
# panos_ipsec_tunnel.partner-ipsec-tunnel will be updated in-place
~ resource "panos_ipsec_tunnel" "partner-ipsec-tunnel" {
ak_ike_gateway = "partner-gw"
ak_ipsec_crypto_profile = "partner-ipsec-crypto-profile"
anti_replay = false
copy_flow_label = false
copy_tos = false
disabled = false
enable_ipv6 = false
enable_tunnel_monitor = true
gps_prefer_ipv6 = false
gps_publish_connected_routes = false
gps_publish_routes = []
id = "partner-ipsec-tunnel"
name = "partner-ipsec-tunnel"
tunnel_interface = "tunnel.101"
tunnel_monitor_destination_ip = "8.8.8.8"
tunnel_monitor_profile = "partner-tunnel-monitor-profile"
+ tunnel_monitor_proxy_id = "partner-tunnel-monitor"
tunnel_monitor_source_ip = "6.6.6.6"
type = "auto-key"
}
# panos_ipsec_tunnel_proxy_id_ipv4.partner-proxy-id-1 will be created
+ resource "panos_ipsec_tunnel_proxy_id_ipv4" "partner-proxy-id-1" {
+ id = (known after apply)
+ ipsec_tunnel = "partner-ipsec-tunnel"
+ local = "7.7.7.7"
+ name = "partner-1"
+ protocol_any = true
+ remote = "8.0.0.0/8"
}
# panos_ipsec_tunnel_proxy_id_ipv4.partner-proxy-id-monitor will be created
+ resource "panos_ipsec_tunnel_proxy_id_ipv4" "partner-proxy-id-monitor" {
+ id = (known after apply)
+ ipsec_tunnel = "partner-ipsec-tunnel"
+ local = "6.6.6.6"
+ name = "partner-tunnel-monitor"
+ protocol_any = true
+ remote = "8.8.8.8/32"
}
Plan: 2 to add, 1 to change, 0 to destroy.
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
panos_ipsec_tunnel.partner-ipsec-tunnel: Modifying... [id=partner-ipsec-tunnel]
Error: partner-ipsec-tunnel -> tunnel-monitor -> proxy-id is invalid
on policy-partner.tf line 135, in resource "panos_ipsec_tunnel" "partner-ipsec-tunnel":
135: resource "panos_ipsec_tunnel" "partner-ipsec-tunnel" {
Releasing state lock. This may take a few moments...
Describe the bug
When specifying
tunnel_monitor_proxy_id
forpanos_ipsec_tunnel
, the modification fails.Expected behavior
The
tunnel_monitor_proxy_id
forpanos_ipsec_tunnel
should succeed.Current behavior
When adding a
tunnel_monitor_proxy_id
to apanos_ipsec_tunnel
the provider seems to recreate all of the associatedpanos_ipsec_tunnel_proxy_id_ipv4
objects, based on the resulting plan. This seems to cause a sequencing issue or race condition as the proxy-id doesn't seem to exist at the time it is being set on thepanos_ipsec_tunnel
.Possible solution
Possibly do not flush the
panos_ipsec_tunnel_proxy_id_ipv4
objects when adding atunnel_monitor_proxy_id
.Steps to reproduce
The following data is from a redacted/example config and plan. This mirrors my sensitive configuration and output.
In the following plan, I am only adding
tunnel_monitor_proxy_id
. Thepanos_ipsec_tunnel_proxy_id_ipv4
objects already exist in state and on the device.Context
Trying to monitor a tunnel that has been established with a Cisco ASA (policy-based) device. https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA10g000000ClHACA0
Your Environment
Thanks!