Skip to content

Repository files navigation

Vercel Terraform Provider

Requirements

Building The Provider

Clone repository locally and run

mise install
mise run build

Developing the Provider

Run mise install to install the pinned versions of Go, Terraform, GoReleaser, and the development tools.

To compile the provider, run mise run build. GoReleaser writes the provider binary beneath dist/.

mise run build

On macOS and Linux, test a local provider build through the terraform mise task. It builds the provider and creates a temporary CLI configuration containing the development override, leaving your ~/.terraformrc unchanged.

mise run terraform -- plan

To use a Terraform configuration outside this repository, pass its directory with -chdir:

mise run terraform -- -chdir=/path/to/config plan
mise run terraform -- -chdir=/path/to/config apply

Testing

Run the unit tests without creating Vercel resources:

mise run test:unit

Run the acceptance tests with:

Note

This runs acceptance tests that will create real resources. You should expect that the full acceptance test suite will take some time to run.

The acceptance tests require a few environment variables to be set:

  • VERCEL_API_TOKEN - this can be generated at vercel.com/account/tokens
  • VERCEL_TERRAFORM_TESTING_TEAM - a Vercel team_id where resources can be created and destroyed
  • VERCEL_TERRAFORM_TESTING_GITHUB_REPO - a GitHub repository in the form 'org/repo' that can be used to trigger deployments
  • VERCEL_TERRAFORM_TESTING_BITBUCKET_REPO - a Bitbucket repository in the form 'project/repo' that can be used to trigger deployments
  • VERCEL_TERRAFORM_TESTING_GITLAB_REPO - a GitLab repository in the form 'project/repo' that can be used to trigger deployments
  • VERCEL_TERRAFORM_TESTING_DOMAIN - a Vercel testing domain that can be used for testing
  • VERCEL_TERRAFORM_TESTING_EXISTING_INTEGRATION - a Vercel integration that can be used for testing
mise run test:acceptance

In order to run the tests with extra debugging context, prefix with TF_LOG (see the terraform documentation for details).

TF_LOG=INFO mise run test:acceptance

To run a specific set of tests, use the -run flag and specify a regex pattern matching the test names.

mise run test:acceptance -run 'TestAcc_Project*'

Building The Documentation

mise run docs

The documentation is autogenerated from Description fields within the provider, and the examples directory. Building the documentation generates markdown in the docs folder, ready for deployment to Hashicorp.

About

Terraform Vercel Provider

Topics

Resources

Code of conduct

Security policy

Stars

191 stars

Watchers

47 watching

Forks

Releases

Used by

Contributors

Languages