IBM-Cloud / terraform-provider-ibm

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

ibm_resource_key and Databases for Postgresql #456

Closed kirktso closed 5 years ago

kirktso commented 5 years ago

Terraform Version

❯ terraform -version
Terraform v0.11.10
+ provider.ibm (unversioned)
+ provider.local v1.1.0

provider.ibm is not reporting its version here. It is 0.13.0.

Affected Resource(s)

ibm_resource_key.postgresql

Terraform Configuration Files

resource "ibm_resource_instance" "postgresql-us-south-dev-sh-too" {
  name              = "PostgreSQL US South Dev SH Too"
  service           = "databases-for-postgresql"
  plan              = "standard"
  location          = "us-south"
  resource_group_id = "${data.ibm_resource_group.group.id}"
}

resource "ibm_resource_key" "postgresql-us-south-dev-sh-too" {
  name                  = "postgresql-us-south-dev-sh-too"
  role                  = "Operator"
  resource_instance_id  = "${ibm_resource_instance.postgresql-us-south-dev-sh-too.id}"
}

Debug Output

Please provider a link to a GitHub Gist containing the complete debug output: https://www.terraform.io/docs/internals/debugging.html. Please do NOT paste the debug output in the issue; just paste a link to the Gist.

Panic Output

If Terraform produced a panic, please provide a link to a GitHub Gist containing the output of the crash.log.

Expected Behavior

There should not be an error.

Actual Behavior

The following error is shown during terraform apply:

Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  + ibm_resource_key.postgresql-us-south-dev-sh-too
      id:                   <computed>
      credentials.%:        <computed>
      name:                 "postgresql-us-south-dev-sh-too"
      parameters.%:         <computed>
      resource_instance_id: "crn:v1:bluemix:public:databases-for-postgresql:us-south:a/525a68e8dc23379b3c04421286ea18b3:59603702-4d32-4a47-bf88-d0842d03e98d::"
      role:                 "Operator"
      status:               <computed>

Plan: 1 to add, 0 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

ibm_resource_key.postgresql-us-south-dev-sh-too: Creating...
  credentials.%:        "" => "<computed>"
  name:                 "" => "postgresql-us-south-dev-sh-too"
  parameters.%:         "" => "<computed>"
  resource_instance_id: "" => "crn:v1:bluemix:public:databases-for-postgresql:us-south:a/525a68e8dc23379b3c04421286ea18b3:59603702-4d32-4a47-bf88-d0842d03e98d::"
  role:                 "" => "Operator"
  status:               "" => "<computed>"

Error: Error applying plan:

1 error(s) occurred:

* ibm_resource_key.postgresql-us-south-dev-sh-too: 1 error(s) occurred:

* ibm_resource_key.postgresql-us-south-dev-sh-too: unexpected EOF

The resource key is created every time I run terraform apply. However, every time I run it, I get the above message - even though it is already out there multiple times.

Steps to Reproduce

  1. terraform apply

Important Factoids

References

N/A

hkantare commented 5 years ago

The fix of #451 resolves this issues...The fix is available in master

hkantare commented 5 years ago

Fix is available in latest release https://github.com/IBM-Cloud/terraform-provider-ibm/releases/tag/v0.14.0

kirktso commented 5 years ago

Thank you @hkantare. This seems to be working now.