Closed stobias123 closed 1 year ago
It seems like Terraform is doing the right thing here, as is the provider.
When a data source (or resource) performs a read operation, if that thing doesn't exist for whatever reason, the provider is supposed to set the Id
to an empty string. This tells Terraform that the thing doesn't exist anymore and it's removed from state. In the case of resources, this tells Terraform that it would need to re-create (or create for the first time) this resource, which is why "this doesn't exist" cannot be an error.
Here, since the provider sets the Id
to empty for data.panos_address_object.blah
, Terraform knows it doesn't exist, and then you try to use a null in the panos_panorama_security_rule_group.rules
resource. Terraform knows that it cannot use a null and errors out without invoking any create/update operation.
Closing as the question has been answered.
Describe the bug
Trying to find an address object that does not exist, results in the data block returning successfully, but empty.
Expected behavior
I expect it to fail at the data block telling me resource not found.
Current behavior
Downstream modules that depend on this data block attempt to apply, but fail due to the value being null.
Steps to reproduce
Your Environment