Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save izmilia-prastika/5297f6a6d1723469cef0d078529a09eb to your computer and use it in GitHub Desktop.
Save izmilia-prastika/5297f6a6d1723469cef0d078529a09eb to your computer and use it in GitHub Desktop.
Contoh module Heroku
terraform {
required_providers {
heroku = {
source = "heroku/heroku"
version = "~> 5.0"
}
}
}
variable "example_app_name" {
description = "Name of the Heroku app provisioned as an example"
}
resource "heroku_app" "example" {
name = var.example_app_name
region = "us"
}
# Build code & release to the app
resource "heroku_build" "example" {
app_id = heroku_app.example.id
buildpacks = ["https://github.com/mars/create-react-app-buildpack.git"]
source {
url = "https://github.com/mars/cra-example-app/archive/v2.1.1.tar.gz"
version = "2.1.1"
}
}
# Launch the app's web process by scaling-up
resource "heroku_formation" "example" {
app_id = heroku_app.example.id
type = "web"
quantity = 1
size = "Standard-1x"
depends_on = [heroku_build.example]
}
output "example_app_url" {
value = heroku_app.example.web_url
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment