IBM-Cloud / terraform-provider-ibm

https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs
Mozilla Public License 2.0
341 stars 670 forks source link

ibm_is_virtual_network_interface_floating_ip: inconsistent behaviour returns null instead of error #5757

Closed sean-freeman closed 2 weeks ago

sean-freeman commented 3 weeks ago

Community Note

Terraform CLI and Terraform IBM Provider Version

Terraform 1.5.5 with all Terraform Providers since this data resource was added

Affected Resource(s)

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

data "ibm_is_virtual_network_interface_floating_ip" "test" {
  virtual_network_interface = "xxxx"
  floating_ip = "xxxx"
}

Debug Output

Return Code 0, without stderr, and all data fields incorrectly return as null:

    "address": null
    "crn": null
    "deleted": null
    "floating_ip": null
    "href": null
    "id": null
    "name": null
    "virtual_network_interface": null

Expected Behavior

Consistency with all other data source behaviour, such as:

In this case it should be:

stderr [ERROR] No Virtual Network Interface to Floating IP attachment found for the resource IDs

Steps to Reproduce

  1. terraform apply
ujjwal-ibm commented 2 weeks ago

looking at it

ujjwal-ibm commented 2 weeks ago

created a fix to resolve this