Configure vercel resources such as projects, deployments and secrets as code with terraform.
This provider has not reached feauture parity with the vercel api yet. I am adding new features as I need them. Please create an issue if you require a certain feature, I will work on them asap.
Available features can be found here.
- Create a token here
- Create a
vercel.tf
file with the following content.- Replace
<YOUR_TOKEN>
with the token from step 1. Alternatively you can set theVERCEL_TOKEN
environment variable - Change the
git_repository
to whatever you want to deploy.
- Replace
terraform {
required_providers {
vercel = {
source = "registry.terraform.io/chronark/vercel"
version = ">=0.10.3"
}
}
}
provider "vercel" {
token = "<YOUR_TOKEN>"
}
resource "vercel_project" "my_project" {
name = "mercury-via-terraform"
git_repository {
type = "github"
repo = "chronark/mercury"
}
}
- Run
terraform init
terraform apply
- Check vercel's dashboard to see your project.
- Push to the default branch of your repository to create your first deployment.
Documentation can be found here