heroku / terraform-provider-heroku

Terraform Heroku provider
https://registry.terraform.io/providers/heroku/heroku/latest
Mozilla Public License 2.0
99 stars 75 forks source link

provider "registry.terraform.io/-/heroku" produced an invalid new value for .local_checksum #246

Closed jacqueline91 closed 4 years ago

jacqueline91 commented 4 years ago

Terraform Version

Terraform v0.12.19

Heroku Provider Version

provider.heroku v2.2.1

Affected Resource(s)

Terraform Configuration Files

main.tf

provider "heroku" {
  version = "2.2.1"
  email = var.heroku_account_email
  api_key = var.heroku_api_key
}
provider "mongodbatlas" {
  version = "~> 0.3"
  public_key = var.mongodbatlas_public_key
  private_key = var.mongodbatlas_private_key
}

app.tf

resource "heroku_app" "staging" {
  name = var.heroku_develop_app
  region = var.heroku_region

  config_vars = {
    APP_ENV = "staging",
    MONGODB_URI = "URL to MongoDB"
  }

  buildpacks = [
    "heroku/nodejs"
  ]
}

resource "heroku_build" "staging" {
  app = heroku_app.staging.id

  source = {
    path = "./"
  }
}

output.tf

output "staging_url" {
  value = "https://${heroku_app.staging.name}.herokuapp.com"
}

Debug Output

https://gist.github.com/jacqueline91/1609df7526cd25fa472c57781c9c0c3f

Panic Output

N/A

Expected Behavior

After the terraform plan command is used, terraform creates an execution plan. In this this plan it will be set the argument checksum in source.path, if local path to the root directory is set. The command terraform apply use this plan. it will be deploy the app to heroku.

Actual Behavior

The heroku-provider produced an invalid new value for .local_checksum and dosn't deploy the app to heroku.

Steps to Reproduce

  1. terraform init
  2. terraform plan -out=terraform.plan
  3. terraform apply terraform.plan
davidji99 commented 4 years ago

While looking at your linked gist, I noticed you might have plaintexted config var credentials. I suggest you redact any credentials in your gist and rotate them. You can also use sensitive_config_vars instead of config_vars so that these credentials remain redacted in the plan and/or apply.

davidji99 commented 4 years ago

@mars Does the author's plan look anything out of the ordinary? I believe you had a PR in the past to address some checksum issue.

jacqueline91 commented 4 years ago

I am very sorry. That was my fault. I didn't point to the correct directory in source.path