vmware / terraform-provider-nsxt

Terraform Provider for VMware NSX
https://registry.terraform.io/providers/vmware/nsxt/
Mozilla Public License 2.0
133 stars 85 forks source link

State refresh fails for nsxt_policy_predefined_security_policy #624

Closed itcanadian closed 3 years ago

itcanadian commented 3 years ago

Terraform Version

0.14

Terraform Configuration Files

data "nsxt_policy_security_policy" "default_l3_app_data" {
  is_default = true
  category   = "Application"
}

resource "nsxt_policy_predefined_security_policy" "pol_default_layer3_section" {
  path = data.nsxt_policy_security_policy.default_l3_app_data.path
  default_rule {
    action = "DROP"
  }
}

Expected Behavior

Terraform plan succeeds with state refresh occuring without errors.

Actual Behavior

Terraform plan fails and is unable to refresh the state of the existing resource.

Steps to reproduce

  1. Define a new nsxt_policy_predefined_security_policy resource with action of DROP
  2. Walk through the terraform apply stage to have the resource pushed out to NSX-T
  3. Attempt a terraform plan after the resource is successfully created.

Error Output

nsxt_policy_predefined_security_policy.pol_default_layer3_section: Refreshing state... [id=default-layer3-section]
Error: Post "https:///api": http: no Host in request URL
  on <empty> line 0:
  (source code not available)
itcanadian commented 3 years ago

We've concluded that the source of our error wasn't in fact this resource but rather a different provider causing the ambiguous error. The timing occurred right after using the new beta resources, and the error was ambiguous enough that we jumped to a conclusion of the beta code being the cause.