-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Importing postgres-db doesn't import config version #176
Comments
Hi @chdsbd 😄
This is not how See Terraform docs about import, "It does not generate configuration." |
I think you misunderstand. I created a resource that matches the Heroku config, but when I import, the heroku provider doesn't import the config version. Edit: by "config", I literally mean the "config" field in the Terraform state. The "config" state is not pulled down from Heroku when importing. |
@mars I've updated my expected behavior a bit. Please reopen this PR. |
I think I found the bug. Please see the updated references section of this issue. |
This is a limitation of the Heroku Platform API. I'm not seeing an API endpoint that would allow the provider to |
Thanks for looking that up @davidji99. It seems like this should be labeled "Heroku API Support". |
EDIT: This is the endpoint for fetching |
Hello, I recently ran into this after Heroku updated Postgres to v12. Since we have now way to get the initial config from the API, my workaround for existing DB addons is to specify the desired version but ignore all changes in the attributes. Which I should have done in the first place since I don't want TF to manage changes to the database
|
Terraform Version
Heroku Provider Version
Affected Resource(s)
Terraform Configuration Files
Debug Output
N/A
Panic Output
N/A
Expected Behavior
Importing a postgres-db resource should update the config state to match the version config definition on Heroku.
If I have a postgres database on Heroku that is configured to be version 10, when I import that resource, the Terraform state should include
config.version = "10"
.So in my example, while my Terraform configuration matches the Heroku add-on. When I import the Heroku resource, the config version of "10" is not imported. So Terraform thinks it needs to recreate the resource to update that state.
Actual Behavior
The config version was not updated and terraform wants to recreate the resource from scratch
Steps to Reproduce
terraform apply
and observe that a new resource is going to be createdImportant Factoids
N/A
References
It seems like the code for importing addons is incorrect.
When creating resources, we set
config
but when importing, we do not.The text was updated successfully, but these errors were encountered: