PaloAltoNetworks / terraform-provider-panos

Terraform Panos provider
https://www.terraform.io/docs/providers/panos/
Mozilla Public License 2.0
87 stars 71 forks source link

panos_panorama_address_object import forces replacement #271

Closed olbees closed 3 years ago

olbees commented 3 years ago

Describe the bug

Importing a panos_panorama_address_object resource does not import the device group or vsys to the state, and consequently forces a replacement.

Expected behavior

A successful Terraform import of the address object should not force a replacement when Terraform is applied

Current behavior

Currently resource is imported to state successfully, but without device group or vsys, even though both are specified in the terraform .tf file:

################ terraform state show panos_panorama_address_object.apxx02lsvn

panos_panorama_address_object.apxxx02lsvn: resource "panos_panorama_address_object" "apxxx02lsvn" { id = "shared:apxxx02lsvn" name = "apxxx02lsvn" tags = [] type = "ip-netmask" value = "172.16.101.145/32" } ##################

When applying, Terraform attempts to add device group and vsys, specifying that these two properties force a replacement:

############### Terraform will perform the following actions:

panos_panorama_address_object.apxxx02lsvn must be replaced -/+ resource "panos_panorama_address_object" "apxxx02lsvn" {

Possible solution

Import device group and vsys if specified in terraform file

Steps to reproduce

  1. import address object to backend state
  2. terraform plan

Your Environment