IBM-Cloud / terraform-provider-ibm

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

output is not consistent between data and resource in ibm_resource_instance #5542

Open andreainnocenti opened 3 months ago

andreainnocenti commented 3 months ago

Community Note

Terraform CLI and Terraform IBM Provider Version

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.

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please share a link to the ZIP file.

Debug Output

Panic Output

Expected Behavior

I would expect to access the same outputs since RC API always returns them instead, as you can see from the state file, I cannot access attributes like resource_plan_id, account_id and dashboard_url that are present in https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/resource_instance#attribute-reference

"resources": [
    {
      "mode": "data",
      "type": "ibm_resource_instance",
      "name": "existing_machine_learning_instance",
      "provider": "provider[\"registry.terraform.io/ibm-cloud/ibm\"]",
      "instances": [
        {
          "schema_version": 0,
          "attributes": {
            "crn": "crn:v1:bluemix:public:pm-20:eu-gb:a/0e550c0a99db49b1813ffb36fadec76b:7bf9d14b-fb35-4ea6-9270-9d57f930e4f5::",
            "extensions": {},
            "guid": "7bf9d14b-fb35-4ea6-9270-9d57f930e4f5",
            "id": "crn:v1:bluemix:public:pm-20:eu-gb:a/0e550c0a99db49b1813ffb36fadec76b:7bf9d14b-fb35-4ea6-9270-9d57f930e4f5::",
            "identifier": "crn:v1:bluemix:public:pm-20:eu-gb:a/0e550c0a99db49b1813ffb36fadec76b:7bf9d14b-fb35-4ea6-9270-9d57f930e4f5::",
            "location": "eu-gb",
            "name": "Watson Machine Learning-n9",
            "parameters_json": null,
            "plan": "lite",
            "resource_controller_url": "https://cloud.ibm.com/services/",
            "resource_crn": "crn:v1:bluemix:public:pm-20:eu-gb:a/0e550c0a99db49b1813ffb36fadec76b:7bf9d14b-fb35-4ea6-9270-9d57f930e4f5::",
            "resource_group_id": "97b0a36ae5ed431688e6f5295048fd46",
            "resource_group_name": "Default",
            "resource_name": "Watson Machine Learning-n9",
            "resource_status": "active",
            "service": "pm-20",
            "status": "active",
            "tags": []
          },
          "sensitive_attributes": []
        }
      ]
    }
  ],

Actual Behavior

Steps to Reproduce

  1. terraform apply

Important Factoids

References