49 lines
1.0 KiB
HCL
49 lines
1.0 KiB
HCL
terraform {
|
|
required_providers {
|
|
vercel = {
|
|
source = "vercel/vercel"
|
|
version = "~> 0.1"
|
|
}
|
|
local = {
|
|
source = "hashicorp/local"
|
|
version = "~> 2"
|
|
}
|
|
}
|
|
}
|
|
|
|
provider "vercel" {
|
|
api_token = var.vercel_api_token
|
|
}
|
|
|
|
resource "vercel_project" "metaforecast" {
|
|
name = "metaforecast"
|
|
team_id = "quantified-uncertainty"
|
|
framework = "nextjs"
|
|
|
|
environment = [
|
|
for k, v in var.metaforecast_env : {
|
|
key = k
|
|
value = v
|
|
target = ["production"]
|
|
}
|
|
]
|
|
|
|
git_repository = {
|
|
type = "github"
|
|
repo = "QURIresearch/metaforecast"
|
|
}
|
|
}
|
|
|
|
resource "vercel_project_domain" "metaforecast" {
|
|
project_id = vercel_project.metaforecast.id
|
|
domain = "metaforecast.org"
|
|
team_id = "quantified-uncertainty"
|
|
}
|
|
|
|
// should probably be replaced with local bash script
|
|
resource "local_file" "foo" {
|
|
content = join("", concat(["# generated by terraform\n"], [for k, v in var.metaforecast_env : "${k} = \"${v}\"\n"]))
|
|
filename = "${path.module}/../.env.prod"
|
|
file_permission = "0644"
|
|
}
|