This provider is used to configure resources supported by the Heroku Platform API.
See the official documentation to use this provider in a Terraform configuration.
The configuration should specify version 5:
provider "heroku" {
version = "~> 5.0"
}
See Upgrading guide for major version migration help.
👓📚 For more usage info, see Heroku Provider docs.
If you wish to work on the provider, you'll first need Go installed on your machine
(version 1.16+ is required). You'll also need to correctly setup a GOPATH,
as well as adding $GOPATH/bin
to your $PATH
.
With Go language, the repository must be cloned to a specific path in $GOPATH/src
that matches its module import path.
mkdir -p $GOPATH/src/github.com/heroku
cd $GOPATH/src/github.com/heroku
git clone git@github.com:heroku/terraform-provider-heroku
To compile the provider, run make build
. This will build the provider and put the provider binary in the $GOPATH/bin
directory.
$ make build
...
$ $GOPATH/bin/terraform-provider-heroku
...
To use the dev provider with local Terraform, configure a dev override pointing to the directory where terraform-provider-heroku
can be found:
cat << TRC >> ~/.terraformrc
provider_installation {
dev_overrides {
"heroku/heroku" = "$GOPATH/bin"
}
direct {}
}
TRC
Copy the freshly built plugin into Terraform's local plugins directory:
cp $GOPATH/bin/terraform-provider-heroku ~/.terraform.d/plugins/
Set the Heroku provider without a version constraint:
provider "heroku" {}
Then, initialize Terraform:
terraform init
Please see the TESTING guide for detailed instructions on running tests.
This project uses Go Modules for dependency management.
Dependencies can be added or updated as follows:
$ GO111MODULE=on go get github.com/some/module@release-tag
$ GO111MODULE=on go mod tidy
$ GO111MODULE=on go mod vendor
This example will fetch a module at the release tag and record it in your project's go.mod and go.sum files. It's a good idea to tidy up afterward and then copy the dependencies into vendor/.
If a module does not have release tags, then module@master
can be used instead.
Remove all usage from your codebase and run:
$ GO111MODULE=on go mod tidy
$ GO111MODULE=on go mod vendor