Created
November 19, 2023 05:09
-
-
Save izmilia-prastika/5297f6a6d1723469cef0d078529a09eb to your computer and use it in GitHub Desktop.
Contoh module Heroku
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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