cloudamqp / terraform-provider-cloudamqp

Terraform Provider for CloudAMQP
https://registry.terraform.io/providers/cloudamqp/cloudamqp
Mozilla Public License 2.0
35 stars 39 forks source link

Instance Data source #42

Closed crisp2u closed 4 years ago

crisp2u commented 4 years ago

Hello, I noticed that there is no data source for the cloudamqp_instance resource. Are there any plans to implement this ? I'm using cloudamqp on heroku and Heroku provisions the instance and now I'm forced to manually import it.

Thanks

tbroden84 commented 4 years ago

Hi, it's not planned but could take a look later this week.

tbroden84 commented 4 years ago

Have now added a new data source for instance. Also updated our documentation with new information https://docs.cloudamqp.com/cloudamqp_terraform.html#instance

Just out of curiosity, are you able to connect to our customer api when using Heroku?

crisp2u commented 4 years ago

Cool, I'll check it a bit later. Well, by default Heroku does not provide a customer api key, only the instance key. The Instance API seems to be working fine with that. My plan was to use the instance data source to get the instance and then provision the instance using the TF provider but indeed to use the TF provider I will need a customer key. I'll dig a bit more. If this is a dead end I'll provision the instance using the Instance API. BTW, I started building a Python Wrapper around that since I could not find one and I'll make the repo public soon.

Thanks

tbroden84 commented 4 years ago

@crisp2u Did you manage to move forward or was it a dead end?

crisp2u commented 4 years ago

II's on pause for now, I started working on a python wrapper for the API and intend to use that a provisioner after the addon is deployed in heroku but it's a work in progress for now. I don't think it's possible to get a customer key if the instance is provision by heroku, Maybe I can ask heroku support. If you want you can close this and I'll come back with more info when I have it

tbroden84 commented 4 years ago

Did some investigation and unfortunately it will not be possible to get a working customer key from Heroku. The only viable solution right now is to re-create your instance directly at cloudamqp.com in order to use our TF provider.

crisp2u commented 4 years ago

It's fine. Thanks for your support, I'll try to use the API on the created instances since that requires only instance key