Skip to content
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

Imported heroku_app should include buildpacks #249

Closed
mmrobins opened this issue Mar 2, 2020 · 1 comment · Fixed by #257
Closed

Imported heroku_app should include buildpacks #249

mmrobins opened this issue Mar 2, 2020 · 1 comment · Fixed by #257
Assignees

Comments

@mmrobins
Copy link

mmrobins commented Mar 2, 2020

After importing an existing heroku app

terraform import module.myappname.heroku_app.app myappname

The initial plans show that I'm adding buildpacks, even though the existing app has buildpacks

$ terraform plan
...
  # module.myappname.heroku_app.app will be updated in-place
  ~ resource "heroku_app" "app" {
      ..
      + buildpacks            = [
          + "heroku/ruby",
          + "https://github.com/heroku/heroku-buildpack-pgbouncer",
        ]
$ heroku buildpacks -a myappname
=== myappname Buildpack URLs
1. heroku/ruby
2. https://github.com/heroku/heroku-buildpack-pgbouncer

Terraform and Heroku Provider Version

% terraform -v
Terraform v0.12.20
+ provider.heroku v2.1.2

Affected Resource(s)

heroku_app

Terraform Configuration Files

resource "heroku_app" "app" {
  name   = var.app_name
  ...
  buildpacks = [
    "heroku/ruby",
    "https://github.com/heroku/heroku-buildpack-pgbouncer",
  ]
}

Expected Behavior

After the initial terraform import the first terraform plan and apply should show the existing buildpacks.

Actual Behavior

The initial plan shows that I'm adding buildpacks that are already there.

References

This is similar to how config_vars don't show a diff until after the first apply https://github.com/terraform-providers/terraform-provider-heroku/issues/247

@davidji99 davidji99 self-assigned this Mar 21, 2020
davidji99 added a commit that referenced this issue Mar 30, 2020
- change how team/org app is detected for the purpose of setting state attributes
- move down Update() method
- correctly set team/app attributes
davidji99 added a commit that referenced this issue Apr 3, 2020
- change how team/org app is detected for the purpose of setting state attributes
- move down Update() method
- correctly set team/app attributes
davidji99 added a commit that referenced this issue Apr 3, 2020
- change how team/org app is detected for the purpose of setting state attributes
- move down Update() method
- correctly set team/app attributes
@thomsonyeh-czi
Copy link

+1 - I'm seeing the same issue on imported heroku_app resources in Terraform 0.12.24.

davidji99 added a commit that referenced this issue Apr 20, 2020
- change how team/org app is detected for the purpose of setting state attributes
- move down Update() method
- correctly set team/app attributes
davidji99 added a commit that referenced this issue Apr 20, 2020
davidji99 added a commit that referenced this issue Apr 20, 2020
@mars mars closed this as completed in #257 Apr 21, 2020
mars referenced this issue Apr 21, 2020
…-imported-herokuapp-shou

Various bug fixes for `heroku_app` resource
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants