-
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
Newly added config_vars
should show a realistic diff if they already exist
#247
Comments
Just to confirm, is your workflow the following:
If so, does your state file have |
Correct on the workflow And yes, the state file does not have I've found 2 super hacky ways of getting a decent diff 1
2
Method 1 I've tried running |
Gotcha. That's no good if the mmrobins@f408db6 would set all of a config vars under For background, Heroku doesn't differentiate between sensitive and non-sensitive config vars. We added this difference into the provider so that users have a bit more flexibility in managing their config vars in a CI system. Marking Let me take a look at why the |
I would really like to see this work too 👍I wonder if the tricky part will be making it work smoothly with |
Note that config vars set by attached Heroku Addons should be ignored from Terraform state. They change dynamically (such as periodic Postgres credential rotation). IMO Inverting the ownership of their state to Terraform will confuse things. While I believe that App |
Yeah agreed that would really confuse things. Could we make it work so that the |
Yep, that was the original intent.
@bensymonds Is your statement above saying you're trying to manage the same config vars using |
@davidji99 No. I was just thinking given there are two ways to specify config vars (directly in the |
Ah gotcha. It won't be complicated so long as one doesn't manage the same config vars on both resources. Otherwise, you'll get an infinite |
For However during a terraform resource importation, the provider SDK does not have access to the resource's schema so the comparison does not work and nothing is set in state. I've reached out to Hashicorp to see if there is a solution. FYI, what I described above is why |
Currently
config_vars
don't show an accurate diff until after the firstterraform apply
has run with thoseconfig_vars
set. This makes it very tedious to import apps with lots ofconfig_vars
into terraform since you have to manually inspect to make sure you're not accidentally changing things on your first apply run.The same applies to
sensitive_config_vars
, mainly in that they shouldn't show a diff (by diff I mean mention that it's changing something when it's not since it doesn't show the actual diff) if there isn't a change when you're adding them.Terraform Version
Heroku Provider Version
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
When I run
terraform plan
I expect it to show no changes since theEXISTING_CONFIG_VAR
I'm setting is the same as is already in theall_config_vars
value in the state file.Actual Behavior
It shows that there's going to be a change
Steps to Reproduce
terraform plan
orterraform apply
with a newly added config var in yourtf
files that already exists in the actual heroku appThe text was updated successfully, but these errors were encountered: