heroku_app

Provides a Heroku App resource. This can be used to create and manage applications on Heroku.

Example Usage

resource "heroku_app" "default" {
  name   = "my-cool-app"
  region = "us"

  config_vars = {
    FOOBAR = "baz"
  }

  buildpacks = [
    "heroku/go"
  ]
}

Example Usage for a Team

A Heroku "team" was originally called an "organization", and that is still the identifier used in this resource.

resource "heroku_app" "default" {
  name   = "my-cool-app"
  region = "us"

  organization {
    name = "my-cool-team"
  }
}

Argument Reference

The following arguments are supported:

The organization block supports:

Deleting vars

Deleting an entire config_vars or sensitive_config_vars map from a heroku_app configuration will not actually remove the vars on the remote resource. To remove an existing variable, leave these attribute maps in-place and delete only its entries from the map. Once these attributes are empty, the map itself may be deleted from the configuration. Otherwise if one deletes the map with existing entries, the config vars will not be deleted from the remote resource.

This is especially important if you are migrating all config_vars to sensitive_config_vars or migrating config vars to heroku_app_config_association resource.

Attributes Reference

The following attributes are exported:

Import

Apps can be imported using an existing app's UUID or name.

For example:

$ terraform import heroku_app.foobar MyApp
$ terraform import heroku_app.foobar e74ac056-7d00-4a7e-aa80-df4bc413a825

Please note: config_vars & sensitive_config_vars will not be imported due to limitations of Terraform's import process (see issue). All vars will appear to be added on the next plan/apply. The diff may be manually reconciled using the outputs of heroku config & terraform plan.