Skip to content

Commit

Permalink
Clarify documented constraints for Build resource
Browse files Browse the repository at this point in the history
  • Loading branch information
mars authored Jun 15, 2023
1 parent 49d4874 commit 7311531
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions docs/resources/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ between `heroku.yml` and Terraform, such as addons or config vars.
A `source.url` may point to any `https://` URL that responds to a `GET` with a tarball source code. When running `terraform apply`,
the source code will only be fetched once for a successful build. Change the URL to force a new resource.

Useful for building public, open-source source code, such as projects that publish releases on GitHub.
💡 Useful for building public, open-source source code, such as projects that publish releases on GitHub.

⛔ Not useful for private URLs that require credentials to access.

### GitHub URLs
GitHub provides [release](https://help.github.com/articles/creating-releases/) tarballs through URLs. Create a release
Expand Down Expand Up @@ -97,13 +99,18 @@ A `source.path` may point to either:

* a tarball of source code
* a directory of source code
* use `src/appname` relative paths to child directories within the Terraform project repo (recommended)
* use `src/appname` relative paths to subdirectories within the Terraform project repo (recommended)
* use `/opt/src/appname` absolute or `../appname` relative paths to external directories
* **avoid ancestor paths that contain the Terraform configuration itself**
* paths such as `../` will [cause errors during apply](https://github.com/heroku/terraform-provider-heroku/issues/269)

When running `terraform apply`, if the contents (SHA256) of the source path changed since the last `apply`, then a new build will start.

🚚 **The complete source must already be present at its `path` when Terraform runs**, so either:
* copy/clone/checkout the source to the `path` before Terraform runs, like [this issue's solution](https://github.com/heroku/terraform-provider-heroku/issues/321#issuecomment-926778363)
* commit the source code into a subdirectory of the Terraform project repository, so that that it's all cloned together.


### Example Usage with Local Source Directory

```hcl-terraform
Expand Down

0 comments on commit 7311531

Please sign in to comment.