page_title | subcategory | description |
---|---|---|
vercel_project Resource - terraform-provider-vercel |
Provides a Project resource.
A Project groups deployments and custom domains. To deploy on Vercel, you need to create a Project.
For more detailed information, please see the Vercel documentation https://vercel.com/docs/concepts/projects/overview.
~> Terraform currently provides a standalone Project Environment Variable resource (a single Environment Variable), a Project Environment Variables resource (multiple Environment Variables), and this Project resource with Environment Variables defined in-line via the environment field.
At this time you cannot use a Vercel Project resource with in-line environment in conjunction with any vercel_project_environment_variables or vercel_project_environment_variable resources. Doing so will cause a conflict of settings and will overwrite Environment Variables. |
Provides a Project resource.
A Project groups deployments and custom domains. To deploy on Vercel, you need to create a Project.
For more detailed information, please see the Vercel documentation.
~> Terraform currently provides a standalone Project Environment Variable resource (a single Environment Variable), a Project Environment Variables resource (multiple Environment Variables), and this Project resource with Environment Variables defined in-line via the environment
field.
At this time you cannot use a Vercel Project resource with in-line environment
in conjunction with any vercel_project_environment_variables
or vercel_project_environment_variable
resources. Doing so will cause a conflict of settings and will overwrite Environment Variables.
# A project that is connected to a git repository.
# Deployments will be created automatically
# on every branch push and merges onto the Production Branch.
resource "vercel_project" "with_git" {
name = "example-project-with-git"
framework = "nextjs"
git_repository = {
type = "github"
repo = "vercel/some-repo"
}
}
# A project that is not connected to a git repository.
# Deployments will need to be created manually through
# terraform, or via the vercel CLI.
resource "vercel_project" "example" {
name = "example-project"
framework = "nextjs"
}
name
(String) The desired name for the project.
auto_assign_custom_domains
(Boolean) Automatically assign custom production domains after each Production deployment via merge to the production branch or Vercel CLI deploy with --prod. Defaults totrue
automatically_expose_system_environment_variables
(Boolean) Vercel provides a set of Environment Variables that are automatically populated by the System, such as the URL of the Deployment or the name of the Git branch deployed. To expose them to your Deployments, enable this fieldbuild_command
(String) The build command for this project. If omitted, this value will be automatically detected.customer_success_code_visibility
(Boolean) Allows Vercel Customer Support to inspect all Deployments' source code in this project to assist with debugging.dev_command
(String) The dev command for this project. If omitted, this value will be automatically detected.directory_listing
(Boolean) If no index file is present within a directory, the directory contents will be displayed.enable_affected_projects_deployments
(Boolean) When enabled, Vercel will automatically deploy all projects that are affected by a change to this project.environment
(Attributes Set) A set of Environment Variables that should be configured for the project. (see below for nested schema)framework
(String) The framework that is being used for this project. If omitted, no framework is selected.function_failover
(Boolean) Automatically failover Serverless Functions to the nearest region. You can customize regions through vercel.json. A new Deployment is required for your changes to take effect.git_comments
(Attributes) Configuration for Git Comments. (see below for nested schema)git_fork_protection
(Boolean) Ensures that pull requests targeting your Git repository must be authorized by a member of your Team before deploying if your Project has Environment Variables or if the pull request includes a change to vercel.json. Defaults totrue
.git_lfs
(Boolean) Enables Git LFS support. Git LFS replaces large files such as audio samples, videos, datasets, and graphics with text pointers inside Git, while storing the file contents on a remote server like GitHub.com or GitHub Enterprise.git_repository
(Attributes) The Git Repository that will be connected to the project. When this is defined, any pushes to the specified connected Git Repository will be automatically deployed. This requires the corresponding Vercel for Github, Gitlab or Bitbucket plugins to be installed. (see below for nested schema)ignore_command
(String) When a commit is pushed to the Git repository that is connected with your Project, its SHA will determine if a new Build has to be issued. If the SHA was deployed before, no new Build will be issued. You can customize this behavior with a command that exits with code 1 (new Build needed) or code 0.install_command
(String) The install command for this project. If omitted, this value will be automatically detected.node_version
(String) The version of Node.js that is used in the Build Step and for Serverless Functions. A new Deployment is required for your changes to take effect.oidc_token_config
(Attributes) Configuration for OpenID Connect (OIDC) tokens. (see below for nested schema)options_allowlist
(Attributes) Disable Deployment Protection for CORS preflightOPTIONS
requests for a list of paths. (see below for nested schema)output_directory
(String) The output directory of the project. If omitted, this value will be automatically detected.password_protection
(Attributes) Ensures visitors of your Preview Deployments must enter a password in order to gain access. (see below for nested schema)preview_comments
(Boolean) Whether to enable comments on your Preview Deployments. If omitted, comments are controlled at the team level (default behaviour).prioritise_production_builds
(Boolean) If enabled, builds for the Production environment will be prioritized over Preview environments.protection_bypass_for_automation
(Boolean) Allow automation services to bypass Deployment Protection on this project when using an HTTP header namedx-vercel-protection-bypass
with a value of theprotection_bypass_for_automation_secret
field.protection_bypass_for_automation_secret
(String, Sensitive) Ifprotection_bypass_for_automation
is enabled, optionally set this value to specify a 32 character secret, otherwise a secret will be generated.public_source
(Boolean) By default, visitors to the/_logs
and/_src
paths of your Production and Preview Deployments must log in with Vercel (requires being a member of your team) to see the Source, Logs and Deployment Status of your project. Settingpublic_source
totrue
disables this behaviour, meaning the Source, Logs and Deployment Status can be publicly viewed.resource_config
(Attributes) Resource Configuration for the project. (see below for nested schema)root_directory
(String) The name of a directory or relative path to the source code of your project. If omitted, it will default to the project root.serverless_function_region
(String) The region on Vercel's network to which your Serverless Functions are deployed. It should be close to any data source your Serverless Function might depend on. A new Deployment is required for your changes to take effect. Please see Vercel's documentation for a full list of regions.skew_protection
(String) Ensures that outdated clients always fetch the correct version for a given deployment. This value defines how long Vercel keeps Skew Protection active.team_id
(String) The team ID to add the project to. Required when configuring a team resource if a default team has not been set in the provider.trusted_ips
(Attributes) Ensures only visitors from an allowed IP address can access your deployment. (see below for nested schema)vercel_authentication
(Attributes) Ensures visitors to your Preview Deployments are logged into Vercel and have a minimum of Viewer access on your team. (see below for nested schema)
id
(String) The ID of this resource.
Required:
key
(String) The name of the Environment Variable.value
(String, Sensitive) The value of the Environment Variable.
Optional:
comment
(String) A comment explaining what the environment variable is for.custom_environment_ids
(Set of String) The IDs of Custom Environments that the Environment Variable should be present on. At least one oftarget
orcustom_environment_ids
must be set.git_branch
(String) The git branch of the Environment Variable.sensitive
(Boolean) Whether the Environment Variable is sensitive or not. (May be affected by a team-wide environment variable policy)target
(Set of String) The environments that the Environment Variable should be present on. Valid targets are eitherproduction
,preview
, ordevelopment
. At least one oftarget
orcustom_environment_ids
must be set.
Read-Only:
id
(String) The ID of the Environment Variable.
Required:
on_commit
(Boolean) Whether Commit comments are enabledon_pull_request
(Boolean) Whether Pull Request comments are enabled
Required:
repo
(String) The name of the git repository. For example:vercel/next.js
.type
(String) The git provider of the repository. Must be eithergithub
,gitlab
, orbitbucket
.
Optional:
deploy_hooks
(Attributes Set) Deploy hooks are unique URLs that allow you to trigger a deployment of a given branch. See https://vercel.com/docs/deployments/deploy-hooks for full information. (see below for nested schema)production_branch
(String) By default, every commit pushed to the main branch will trigger a Production Deployment instead of the usual Preview Deployment. You can switch to a different branch here.
Required:
name
(String) The name of the deploy hook.ref
(String) The branch or commit hash that should be deployed.
Read-Only:
id
(String) The ID of the deploy hook.url
(String, Sensitive) A URL that, when a POST request is made to, will trigger a new deployment.
Required:
enabled
(Boolean) When true, Vercel issued OpenID Connect (OIDC) tokens will be available on the compute environments. See https://vercel.com/docs/security/secure-backend-access/oidc for more information.
Optional:
issuer_mode
(String) Configures the URL of theiss
claim.team
=https://oidc.vercel.com/[team_slug]
global
=https://oidc.vercel.com
Required:
paths
(Attributes Set) The allowed paths for the OPTIONS Allowlist. Incoming requests will bypass Deployment Protection if they have the methodOPTIONS
and start with one of the path values. (see below for nested schema)
Required:
value
(String) The path prefix to compare with the incoming request path.
Required:
deployment_type
(String) The deployment environment to protect. Must be one ofstandard_protection
,all_deployments
, oronly_preview_deployments
.password
(String, Sensitive) The password that visitors must enter to gain access to your Preview Deployments. Drift detection is not possible for this field.
Optional:
function_default_cpu_type
(String) The amount of CPU available to your Serverless Functions. Should be one of 'standard_legacy' (0.6vCPU), 'standard' (1vCPU) or 'performance' (1.7vCPUs).function_default_timeout
(Number) The default timeout for Serverless Functions.
Required:
addresses
(Attributes Set) The allowed IP addressses and CIDR ranges with optional descriptions. (see below for nested schema)deployment_type
(String) The deployment environment to protect. Must be one ofstandard_protection
,all_deployments
,only_production_deployments
, oronly_preview_deployments
.
Optional:
protection_mode
(String) Whether or not Trusted IPs is optional to access a deployment. Must be eithertrusted_ip_required
ortrusted_ip_optional
.trusted_ip_optional
is only available with Standalone Trusted IPs.
Required:
value
(String, Sensitive) The address or CIDR range that can access deployments.
Optional:
note
(String) A description for the value
Required:
deployment_type
(String) The deployment environment to protect. Must be one ofstandard_protection
,all_deployments
,only_preview_deployments
, ornone
.
Import is supported using the following syntax:
# If importing into a personal account, or with a team configured on
# the provider, simply use the project ID.
# - project_id can be found in the project `settings` tab in the Vercel UI.
terraform import vercel_project.example prj_xxxxxxxxxxxxxxxxxxxxxxxxxxxx
# Alternatively, you can import via the team_id and project_id.
# - team_id can be found in the team `settings` tab in the Vercel UI.
# - project_id can be found in the project `settings` tab in the Vercel UI.
terraform import vercel_project.example team_xxxxxxxxxxxxxxxxxxxxxxxx/prj_xxxxxxxxxxxxxxxxxxxxxxxxxxxx