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

heroku_slug does not recognize file_path is the same when it is calculated #208

Open
robertcnix opened this issue Jun 25, 2019 · 1 comment

Comments

@robertcnix
Copy link

robertcnix commented Jun 25, 2019

Terraform Version

$ terraform -v
Terraform v0.11.14
+ provider.heroku v2.0.0
+ provider.local v1.2.2
+ provider.null v2.1.2
+ provider.vault v1.9.0

Affected Resource(s)

Please list the resources as a list, for example:

  • heroku_slug

Terraform Configuration Files

resource "heroku_app" "default" {
  name             = "${local.full_name}"
  region           = "${data.heroku_space.default.region}"
  space            = "${data.heroku_space.default.name}"
  internal_routing = "${local.internal_routing}"

  organization {
    name = "${data.heroku_space.default.organization}"
  }
}

resource "heroku_app_config_association" "default" {
  app_id         = "${heroku_app.default.id}"
  vars           = "${local.config_vars}"
  sensitive_vars = "${local.sensitive_vars}"
}

resource "heroku_slug" "default" {
  app           = "${heroku_app.default.id}"
  file_path     = "${local.build_home}/${local.service_name}/${local.service_version}/app.tgz"
  process_types = "${local.process_types}"
}

resource "heroku_app_release" "default" {
  app     = "${heroku_app.default.name}"
  slug_id = "${heroku_slug.default.id}"
}

Debug Output

I will provide access to the private gist upon request

Expected Behavior

Running terraform apply twice in a row without any changes to any local, external dependencies should not redeploy the slug.

Actual Behavior

The calculated-nature of the file_path appears to cause the provider to think the slug has changed even though the checksum remains stable from run to run.

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply
  2. terraform apply

Important Factoids

I have confirmed that when I hardcode the full path to the slug, the plan comes back clean after a successful apply.

@robertcnix
Copy link
Author

robertcnix commented Jun 26, 2019

I tested with this version and it seems to function properly:

# terraform -v
Terraform v0.12.3
+ provider.heroku v2.0.1
+ provider.local v1.2.2
+ provider.null v2.1.2
+ provider.vault v2.0.0

I'm a little 😞 with 0.12.x because of

Using a variables file to set an undeclared variable is deprecated and will
become an error in a future release. If you wish to provide certain "global"
settings to all configurations in your organization, use TF_VAR_...
environment variables to set these instead.

It means we won't be able to share a common tfvars file that has generic top-level values unless we define those variables in all the terraform definitions. Annoying! We'll have to use maps and lists for most top-level values but working with maps can be painful, especially using nested maps. Also, the suggestion to use TF_VAR_ is confusing. TF_VAR_ should be far more discouraged than undeclared variables in a tfvars file. TF_VAR_ are easily overlooked when source controlling.

At any rate, we'll consider upgrading to 0.12.x

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

No branches or pull requests

1 participant