PaloAltoNetworks / terraform-provider-scm

The Terraform provider for Strata Cloud Manager
Apache License 2.0
7 stars 2 forks source link

`scm_remote_network` gives an error when explicit provider host is not set #20

Closed zbuchheit closed 2 months ago

zbuchheit commented 3 months ago

Describe the bug

When attempting to use the scm_remote_network resource or data object, I get an object not found error.

When looking at the logs I noticed when host isn't set the api call is made to Host: api.strata.paloaltonetworks.com which I would expect it to actually be api.sase.paloaltonetworks.com. When I set the host on the provider it is able to make the api call correctly. I suspect this might be coming from the scm-go library somehow setting an incorrect default for certain resources. I also witness this behavior with scm_service_connection

Expected behavior

Create or query a remote network resource correctly without error

Current behavior

I encounter a object not found error

Possible solution

I suspect this is related to https://github.com/PaloAltoNetworks/terraform-provider-scm/issues/19 as it is the same behavior

Steps to reproduce

  1. Create a remote network manually (or alternatively attempt to create one) without host set on the provider
  2. Run terraform plan
  3. Witness error
  4. Set provider host to be "api.sase.paloaltonetworks.com"
  5. Witness successful run

Screenshots

Context

Your Environment

shinmog commented 2 months ago

The documentation for the default value for the "host" param within the provider block was incorrect. The default value for "host" is "api.strata.paloaltonetworks.com", so the documentation for this can be updated to reflect the correct default value.

zbuchheit commented 2 months ago

ah so this is working as intended/expected?

shinmog commented 2 months ago

Yes, the intended behavior is that the host param defaults to "api.strata.paloaltonetworks.com".

zbuchheit commented 2 months ago

closing as this works as intended. Thanks!