published on Wednesday, Jul 1, 2026 by Pulumiverse
published on Wednesday, Jul 1, 2026 by Pulumiverse
Provides a Project Route resource.
This resource manages one live project-level routing rule for a Vercel project. Each mutation stages a new routing-rules version and promotes it immediately so Terraform state reflects production traffic behavior.
Reads and imports intentionally target the live version and ignore unpublished staged drafts created outside Terraform.
Position is applied when the rule is created or replaced. Use before and after with reference_route_id when you need deterministic ordering across multiple Terraform-managed rules.
The Vercel API does not return placement metadata for an individual rule. Terraform preserves the configured position on normal reads, but imported routes start with no position in state.
This resource refuses to mutate a project while it has an unpublished staged routing-rules version. Publish, restore, or discard the draft first.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as vercel from "@pulumiverse/vercel";
const example = new vercel.Project("example", {name: "example-project"});
const exampleProjectRoute = new vercel.ProjectRoute("example", {
projectId: example.id,
name: "redirect-legacy-docs",
position: {
placement: "start",
},
route: {
src: "/docs/:path*",
dest: "/guides/:path*",
status: 308,
},
});
const rewriteEuCampaign = new vercel.ProjectRoute("rewrite_eu_campaign", {
projectId: example.id,
name: "rewrite-eu-campaign",
position: {
placement: "after",
referenceRouteId: exampleProjectRoute.id,
},
route: {
src: "/promo",
dest: "/campaigns/eu",
has: [{
type: "header",
key: "x-region",
value: "eu",
}],
missings: [{
type: "cookie",
key: "preview",
value: "1",
}],
},
});
import pulumi
import pulumiverse_vercel as vercel
example = vercel.Project("example", name="example-project")
example_project_route = vercel.ProjectRoute("example",
project_id=example.id,
name="redirect-legacy-docs",
position={
"placement": "start",
},
route={
"src": "/docs/:path*",
"dest": "/guides/:path*",
"status": 308,
})
rewrite_eu_campaign = vercel.ProjectRoute("rewrite_eu_campaign",
project_id=example.id,
name="rewrite-eu-campaign",
position={
"placement": "after",
"reference_route_id": example_project_route.id,
},
route={
"src": "/promo",
"dest": "/campaigns/eu",
"has": [{
"type": "header",
"key": "x-region",
"value": "eu",
}],
"missings": [{
"type": "cookie",
"key": "preview",
"value": "1",
}],
})
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumiverse/pulumi-vercel/sdk/v5/go/vercel"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := vercel.NewProject(ctx, "example", &vercel.ProjectArgs{
Name: pulumi.String("example-project"),
})
if err != nil {
return err
}
exampleProjectRoute, err := vercel.NewProjectRoute(ctx, "example", &vercel.ProjectRouteArgs{
ProjectId: example.ID(),
Name: pulumi.String("redirect-legacy-docs"),
Position: &vercel.ProjectRoutePositionArgs{
Placement: pulumi.String("start"),
},
Route: &vercel.ProjectRouteRouteArgs{
Src: pulumi.String("/docs/:path*"),
Dest: pulumi.String("/guides/:path*"),
Status: pulumi.Int(308),
},
})
if err != nil {
return err
}
_, err = vercel.NewProjectRoute(ctx, "rewrite_eu_campaign", &vercel.ProjectRouteArgs{
ProjectId: example.ID(),
Name: pulumi.String("rewrite-eu-campaign"),
Position: &vercel.ProjectRoutePositionArgs{
Placement: pulumi.String("after"),
ReferenceRouteId: exampleProjectRoute.ID(),
},
Route: &vercel.ProjectRouteRouteArgs{
Src: pulumi.String("/promo"),
Dest: pulumi.String("/campaigns/eu"),
Has: vercel.ProjectRouteRouteHaArray{
&vercel.ProjectRouteRouteHaArgs{
Type: pulumi.String("header"),
Key: pulumi.String("x-region"),
Value: pulumi.String("eu"),
},
},
Missings: vercel.ProjectRouteRouteMissingArray{
&vercel.ProjectRouteRouteMissingArgs{
Type: pulumi.String("cookie"),
Key: pulumi.String("preview"),
Value: pulumi.String("1"),
},
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Vercel = Pulumiverse.Vercel;
return await Deployment.RunAsync(() =>
{
var example = new Vercel.Project("example", new()
{
Name = "example-project",
});
var exampleProjectRoute = new Vercel.ProjectRoute("example", new()
{
ProjectId = example.Id,
Name = "redirect-legacy-docs",
Position = new Vercel.Inputs.ProjectRoutePositionArgs
{
Placement = "start",
},
Route = new Vercel.Inputs.ProjectRouteRouteArgs
{
Src = "/docs/:path*",
Dest = "/guides/:path*",
Status = 308,
},
});
var rewriteEuCampaign = new Vercel.ProjectRoute("rewrite_eu_campaign", new()
{
ProjectId = example.Id,
Name = "rewrite-eu-campaign",
Position = new Vercel.Inputs.ProjectRoutePositionArgs
{
Placement = "after",
ReferenceRouteId = exampleProjectRoute.Id,
},
Route = new Vercel.Inputs.ProjectRouteRouteArgs
{
Src = "/promo",
Dest = "/campaigns/eu",
Has = new[]
{
new Vercel.Inputs.ProjectRouteRouteHaArgs
{
Type = "header",
Key = "x-region",
Value = "eu",
},
},
Missings = new[]
{
new Vercel.Inputs.ProjectRouteRouteMissingArgs
{
Type = "cookie",
Key = "preview",
Value = "1",
},
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumiverse.vercel.Project;
import com.pulumiverse.vercel.ProjectArgs;
import com.pulumiverse.vercel.ProjectRoute;
import com.pulumiverse.vercel.ProjectRouteArgs;
import com.pulumi.vercel.inputs.ProjectRoutePositionArgs;
import com.pulumi.vercel.inputs.ProjectRouteRouteArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new Project("example", ProjectArgs.builder()
.name("example-project")
.build());
var exampleProjectRoute = new ProjectRoute("exampleProjectRoute", ProjectRouteArgs.builder()
.projectId(example.id())
.name("redirect-legacy-docs")
.position(ProjectRoutePositionArgs.builder()
.placement("start")
.build())
.route(ProjectRouteRouteArgs.builder()
.src("/docs/:path*")
.dest("/guides/:path*")
.status(308)
.build())
.build());
var rewriteEuCampaign = new ProjectRoute("rewriteEuCampaign", ProjectRouteArgs.builder()
.projectId(example.id())
.name("rewrite-eu-campaign")
.position(ProjectRoutePositionArgs.builder()
.placement("after")
.referenceRouteId(exampleProjectRoute.id())
.build())
.route(ProjectRouteRouteArgs.builder()
.src("/promo")
.dest("/campaigns/eu")
.has(ProjectRouteRouteHaArgs.builder()
.type("header")
.key("x-region")
.value("eu")
.build())
.missings(ProjectRouteRouteMissingArgs.builder()
.type("cookie")
.key("preview")
.value("1")
.build())
.build())
.build());
}
}
resources:
example:
type: vercel:Project
properties:
name: example-project
exampleProjectRoute:
type: vercel:ProjectRoute
name: example
properties:
projectId: ${example.id}
name: redirect-legacy-docs
position:
placement: start
route:
src: /docs/:path*
dest: /guides/:path*
status: 308
rewriteEuCampaign:
type: vercel:ProjectRoute
name: rewrite_eu_campaign
properties:
projectId: ${example.id}
name: rewrite-eu-campaign
position:
placement: after
referenceRouteId: ${exampleProjectRoute.id}
route:
src: /promo
dest: /campaigns/eu
has:
- type: header
key: x-region
value: eu
missings:
- type: cookie
key: preview
value: '1'
Example coming soon!
Create ProjectRoute Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ProjectRoute(name: string, args: ProjectRouteArgs, opts?: CustomResourceOptions);@overload
def ProjectRoute(resource_name: str,
args: ProjectRouteArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ProjectRoute(resource_name: str,
opts: Optional[ResourceOptions] = None,
project_id: Optional[str] = None,
route: Optional[ProjectRouteRouteArgs] = None,
description: Optional[str] = None,
enabled: Optional[bool] = None,
name: Optional[str] = None,
position: Optional[ProjectRoutePositionArgs] = None,
src_syntax: Optional[str] = None,
team_id: Optional[str] = None)func NewProjectRoute(ctx *Context, name string, args ProjectRouteArgs, opts ...ResourceOption) (*ProjectRoute, error)public ProjectRoute(string name, ProjectRouteArgs args, CustomResourceOptions? opts = null)
public ProjectRoute(String name, ProjectRouteArgs args)
public ProjectRoute(String name, ProjectRouteArgs args, CustomResourceOptions options)
type: vercel:ProjectRoute
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "vercel_projectroute" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args ProjectRouteArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ProjectRouteArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ProjectRouteArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ProjectRouteArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ProjectRouteArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var projectRouteResource = new Vercel.ProjectRoute("projectRouteResource", new()
{
ProjectId = "string",
Route = new Vercel.Inputs.ProjectRouteRouteArgs
{
Src = "string",
CaseSensitive = false,
Dest = "string",
Has = new[]
{
new Vercel.Inputs.ProjectRouteRouteHaArgs
{
Type = "string",
Key = "string",
Value = "string",
},
},
Headers =
{
{ "string", "string" },
},
Missings = new[]
{
new Vercel.Inputs.ProjectRouteRouteMissingArgs
{
Type = "string",
Key = "string",
Value = "string",
},
},
RespectOriginCacheControl = false,
Status = 0,
Transforms = new[]
{
new Vercel.Inputs.ProjectRouteRouteTransformArgs
{
Op = "string",
Type = "string",
Args = "string",
Envs = new[]
{
"string",
},
Target = "string",
},
},
},
Description = "string",
Enabled = false,
Name = "string",
Position = new Vercel.Inputs.ProjectRoutePositionArgs
{
Placement = "string",
ReferenceRouteId = "string",
},
SrcSyntax = "string",
TeamId = "string",
});
example, err := vercel.NewProjectRoute(ctx, "projectRouteResource", &vercel.ProjectRouteArgs{
ProjectId: pulumi.String("string"),
Route: &vercel.ProjectRouteRouteArgs{
Src: pulumi.String("string"),
CaseSensitive: pulumi.Bool(false),
Dest: pulumi.String("string"),
Has: vercel.ProjectRouteRouteHaArray{
&vercel.ProjectRouteRouteHaArgs{
Type: pulumi.String("string"),
Key: pulumi.String("string"),
Value: pulumi.String("string"),
},
},
Headers: pulumi.StringMap{
"string": pulumi.String("string"),
},
Missings: vercel.ProjectRouteRouteMissingArray{
&vercel.ProjectRouteRouteMissingArgs{
Type: pulumi.String("string"),
Key: pulumi.String("string"),
Value: pulumi.String("string"),
},
},
RespectOriginCacheControl: pulumi.Bool(false),
Status: pulumi.Int(0),
Transforms: vercel.ProjectRouteRouteTransformArray{
&vercel.ProjectRouteRouteTransformArgs{
Op: pulumi.String("string"),
Type: pulumi.String("string"),
Args: pulumi.String("string"),
Envs: pulumi.StringArray{
pulumi.String("string"),
},
Target: pulumi.String("string"),
},
},
},
Description: pulumi.String("string"),
Enabled: pulumi.Bool(false),
Name: pulumi.String("string"),
Position: &vercel.ProjectRoutePositionArgs{
Placement: pulumi.String("string"),
ReferenceRouteId: pulumi.String("string"),
},
SrcSyntax: pulumi.String("string"),
TeamId: pulumi.String("string"),
})
resource "vercel_projectroute" "projectRouteResource" {
project_id = "string"
route = {
src = "string"
case_sensitive = false
dest = "string"
has = [{
"type" = "string"
"key" = "string"
"value" = "string"
}]
headers = {
"string" = "string"
}
missings = [{
"type" = "string"
"key" = "string"
"value" = "string"
}]
respect_origin_cache_control = false
status = 0
transforms = [{
"op" = "string"
"type" = "string"
"args" = "string"
"envs" = ["string"]
"target" = "string"
}]
}
description = "string"
enabled = false
name = "string"
position = {
placement = "string"
reference_route_id = "string"
}
src_syntax = "string"
team_id = "string"
}
var projectRouteResource = new ProjectRoute("projectRouteResource", ProjectRouteArgs.builder()
.projectId("string")
.route(ProjectRouteRouteArgs.builder()
.src("string")
.caseSensitive(false)
.dest("string")
.has(ProjectRouteRouteHaArgs.builder()
.type("string")
.key("string")
.value("string")
.build())
.headers(Map.of("string", "string"))
.missings(ProjectRouteRouteMissingArgs.builder()
.type("string")
.key("string")
.value("string")
.build())
.respectOriginCacheControl(false)
.status(0)
.transforms(ProjectRouteRouteTransformArgs.builder()
.op("string")
.type("string")
.args("string")
.envs("string")
.target("string")
.build())
.build())
.description("string")
.enabled(false)
.name("string")
.position(ProjectRoutePositionArgs.builder()
.placement("string")
.referenceRouteId("string")
.build())
.srcSyntax("string")
.teamId("string")
.build());
project_route_resource = vercel.ProjectRoute("projectRouteResource",
project_id="string",
route={
"src": "string",
"case_sensitive": False,
"dest": "string",
"has": [{
"type": "string",
"key": "string",
"value": "string",
}],
"headers": {
"string": "string",
},
"missings": [{
"type": "string",
"key": "string",
"value": "string",
}],
"respect_origin_cache_control": False,
"status": 0,
"transforms": [{
"op": "string",
"type": "string",
"args": "string",
"envs": ["string"],
"target": "string",
}],
},
description="string",
enabled=False,
name="string",
position={
"placement": "string",
"reference_route_id": "string",
},
src_syntax="string",
team_id="string")
const projectRouteResource = new vercel.ProjectRoute("projectRouteResource", {
projectId: "string",
route: {
src: "string",
caseSensitive: false,
dest: "string",
has: [{
type: "string",
key: "string",
value: "string",
}],
headers: {
string: "string",
},
missings: [{
type: "string",
key: "string",
value: "string",
}],
respectOriginCacheControl: false,
status: 0,
transforms: [{
op: "string",
type: "string",
args: "string",
envs: ["string"],
target: "string",
}],
},
description: "string",
enabled: false,
name: "string",
position: {
placement: "string",
referenceRouteId: "string",
},
srcSyntax: "string",
teamId: "string",
});
type: vercel:ProjectRoute
properties:
description: string
enabled: false
name: string
position:
placement: string
referenceRouteId: string
projectId: string
route:
caseSensitive: false
dest: string
has:
- key: string
type: string
value: string
headers:
string: string
missings:
- key: string
type: string
value: string
respectOriginCacheControl: false
src: string
status: 0
transforms:
- args: string
envs:
- string
op: string
target: string
type: string
srcSyntax: string
teamId: string
ProjectRoute Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The ProjectRoute resource accepts the following input properties:
- Project
Id string - The ID of the project to manage a routing rule for.
- Route
Pulumiverse.
Vercel. Inputs. Project Route Route - The routing rule definition.
- Description string
- An optional description of the rule.
- Enabled bool
- Whether the rule is enabled.
- Name string
- A human-readable name for the rule.
- Position
Pulumiverse.
Vercel. Inputs. Project Route Position - Where to insert the rule when it is created or replaced. This metadata is not returned by the API, so imported routes do not infer it.
- Src
Syntax string - The source pattern syntax. You can usually omit this and let Vercel infer it from
route.src. - Team
Id string - The ID of the team the project exists under. Required when configuring a team resource if a default team has not been set in the provider.
- Project
Id string - The ID of the project to manage a routing rule for.
- Route
Project
Route Route Args - The routing rule definition.
- Description string
- An optional description of the rule.
- Enabled bool
- Whether the rule is enabled.
- Name string
- A human-readable name for the rule.
- Position
Project
Route Position Args - Where to insert the rule when it is created or replaced. This metadata is not returned by the API, so imported routes do not infer it.
- Src
Syntax string - The source pattern syntax. You can usually omit this and let Vercel infer it from
route.src. - Team
Id string - The ID of the team the project exists under. Required when configuring a team resource if a default team has not been set in the provider.
- project_
id string - The ID of the project to manage a routing rule for.
- route object
- The routing rule definition.
- description string
- An optional description of the rule.
- enabled bool
- Whether the rule is enabled.
- name string
- A human-readable name for the rule.
- position object
- Where to insert the rule when it is created or replaced. This metadata is not returned by the API, so imported routes do not infer it.
- src_
syntax string - The source pattern syntax. You can usually omit this and let Vercel infer it from
route.src. - team_
id string - The ID of the team the project exists under. Required when configuring a team resource if a default team has not been set in the provider.
- project
Id String - The ID of the project to manage a routing rule for.
- route
Project
Route Route - The routing rule definition.
- description String
- An optional description of the rule.
- enabled Boolean
- Whether the rule is enabled.
- name String
- A human-readable name for the rule.
- position
Project
Route Position - Where to insert the rule when it is created or replaced. This metadata is not returned by the API, so imported routes do not infer it.
- src
Syntax String - The source pattern syntax. You can usually omit this and let Vercel infer it from
route.src. - team
Id String - The ID of the team the project exists under. Required when configuring a team resource if a default team has not been set in the provider.
- project
Id string - The ID of the project to manage a routing rule for.
- route
Project
Route Route - The routing rule definition.
- description string
- An optional description of the rule.
- enabled boolean
- Whether the rule is enabled.
- name string
- A human-readable name for the rule.
- position
Project
Route Position - Where to insert the rule when it is created or replaced. This metadata is not returned by the API, so imported routes do not infer it.
- src
Syntax string - The source pattern syntax. You can usually omit this and let Vercel infer it from
route.src. - team
Id string - The ID of the team the project exists under. Required when configuring a team resource if a default team has not been set in the provider.
- project_
id str - The ID of the project to manage a routing rule for.
- route
Project
Route Route Args - The routing rule definition.
- description str
- An optional description of the rule.
- enabled bool
- Whether the rule is enabled.
- name str
- A human-readable name for the rule.
- position
Project
Route Position Args - Where to insert the rule when it is created or replaced. This metadata is not returned by the API, so imported routes do not infer it.
- src_
syntax str - The source pattern syntax. You can usually omit this and let Vercel infer it from
route.src. - team_
id str - The ID of the team the project exists under. Required when configuring a team resource if a default team has not been set in the provider.
- project
Id String - The ID of the project to manage a routing rule for.
- route Property Map
- The routing rule definition.
- description String
- An optional description of the rule.
- enabled Boolean
- Whether the rule is enabled.
- name String
- A human-readable name for the rule.
- position Property Map
- Where to insert the rule when it is created or replaced. This metadata is not returned by the API, so imported routes do not infer it.
- src
Syntax String - The source pattern syntax. You can usually omit this and let Vercel infer it from
route.src. - team
Id String - The ID of the team the project exists under. Required when configuring a team resource if a default team has not been set in the provider.
Outputs
All input properties are implicitly available as output properties. Additionally, the ProjectRoute resource produces the following output properties:
- id string
- The provider-assigned unique ID for this managed resource.
- route_
type string - The computed route type returned by Vercel. One of
rewrite,redirect,set_status, ortransform.
- id str
- The provider-assigned unique ID for this managed resource.
- route_
type str - The computed route type returned by Vercel. One of
rewrite,redirect,set_status, ortransform.
Look up Existing ProjectRoute Resource
Get an existing ProjectRoute resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: ProjectRouteState, opts?: CustomResourceOptions): ProjectRoute@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
enabled: Optional[bool] = None,
name: Optional[str] = None,
position: Optional[ProjectRoutePositionArgs] = None,
project_id: Optional[str] = None,
route: Optional[ProjectRouteRouteArgs] = None,
route_type: Optional[str] = None,
src_syntax: Optional[str] = None,
team_id: Optional[str] = None) -> ProjectRoutefunc GetProjectRoute(ctx *Context, name string, id IDInput, state *ProjectRouteState, opts ...ResourceOption) (*ProjectRoute, error)public static ProjectRoute Get(string name, Input<string> id, ProjectRouteState? state, CustomResourceOptions? opts = null)public static ProjectRoute get(String name, Output<String> id, ProjectRouteState state, CustomResourceOptions options)resources: _: type: vercel:ProjectRoute get: id: ${id}import {
to = vercel_projectroute.example
id = "${id}"
}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Description string
- An optional description of the rule.
- Enabled bool
- Whether the rule is enabled.
- Name string
- A human-readable name for the rule.
- Position
Pulumiverse.
Vercel. Inputs. Project Route Position - Where to insert the rule when it is created or replaced. This metadata is not returned by the API, so imported routes do not infer it.
- Project
Id string - The ID of the project to manage a routing rule for.
- Route
Pulumiverse.
Vercel. Inputs. Project Route Route - The routing rule definition.
- Route
Type string - The computed route type returned by Vercel. One of
rewrite,redirect,set_status, ortransform. - Src
Syntax string - The source pattern syntax. You can usually omit this and let Vercel infer it from
route.src. - Team
Id string - The ID of the team the project exists under. Required when configuring a team resource if a default team has not been set in the provider.
- Description string
- An optional description of the rule.
- Enabled bool
- Whether the rule is enabled.
- Name string
- A human-readable name for the rule.
- Position
Project
Route Position Args - Where to insert the rule when it is created or replaced. This metadata is not returned by the API, so imported routes do not infer it.
- Project
Id string - The ID of the project to manage a routing rule for.
- Route
Project
Route Route Args - The routing rule definition.
- Route
Type string - The computed route type returned by Vercel. One of
rewrite,redirect,set_status, ortransform. - Src
Syntax string - The source pattern syntax. You can usually omit this and let Vercel infer it from
route.src. - Team
Id string - The ID of the team the project exists under. Required when configuring a team resource if a default team has not been set in the provider.
- description string
- An optional description of the rule.
- enabled bool
- Whether the rule is enabled.
- name string
- A human-readable name for the rule.
- position object
- Where to insert the rule when it is created or replaced. This metadata is not returned by the API, so imported routes do not infer it.
- project_
id string - The ID of the project to manage a routing rule for.
- route object
- The routing rule definition.
- route_
type string - The computed route type returned by Vercel. One of
rewrite,redirect,set_status, ortransform. - src_
syntax string - The source pattern syntax. You can usually omit this and let Vercel infer it from
route.src. - team_
id string - The ID of the team the project exists under. Required when configuring a team resource if a default team has not been set in the provider.
- description String
- An optional description of the rule.
- enabled Boolean
- Whether the rule is enabled.
- name String
- A human-readable name for the rule.
- position
Project
Route Position - Where to insert the rule when it is created or replaced. This metadata is not returned by the API, so imported routes do not infer it.
- project
Id String - The ID of the project to manage a routing rule for.
- route
Project
Route Route - The routing rule definition.
- route
Type String - The computed route type returned by Vercel. One of
rewrite,redirect,set_status, ortransform. - src
Syntax String - The source pattern syntax. You can usually omit this and let Vercel infer it from
route.src. - team
Id String - The ID of the team the project exists under. Required when configuring a team resource if a default team has not been set in the provider.
- description string
- An optional description of the rule.
- enabled boolean
- Whether the rule is enabled.
- name string
- A human-readable name for the rule.
- position
Project
Route Position - Where to insert the rule when it is created or replaced. This metadata is not returned by the API, so imported routes do not infer it.
- project
Id string - The ID of the project to manage a routing rule for.
- route
Project
Route Route - The routing rule definition.
- route
Type string - The computed route type returned by Vercel. One of
rewrite,redirect,set_status, ortransform. - src
Syntax string - The source pattern syntax. You can usually omit this and let Vercel infer it from
route.src. - team
Id string - The ID of the team the project exists under. Required when configuring a team resource if a default team has not been set in the provider.
- description str
- An optional description of the rule.
- enabled bool
- Whether the rule is enabled.
- name str
- A human-readable name for the rule.
- position
Project
Route Position Args - Where to insert the rule when it is created or replaced. This metadata is not returned by the API, so imported routes do not infer it.
- project_
id str - The ID of the project to manage a routing rule for.
- route
Project
Route Route Args - The routing rule definition.
- route_
type str - The computed route type returned by Vercel. One of
rewrite,redirect,set_status, ortransform. - src_
syntax str - The source pattern syntax. You can usually omit this and let Vercel infer it from
route.src. - team_
id str - The ID of the team the project exists under. Required when configuring a team resource if a default team has not been set in the provider.
- description String
- An optional description of the rule.
- enabled Boolean
- Whether the rule is enabled.
- name String
- A human-readable name for the rule.
- position Property Map
- Where to insert the rule when it is created or replaced. This metadata is not returned by the API, so imported routes do not infer it.
- project
Id String - The ID of the project to manage a routing rule for.
- route Property Map
- The routing rule definition.
- route
Type String - The computed route type returned by Vercel. One of
rewrite,redirect,set_status, ortransform. - src
Syntax String - The source pattern syntax. You can usually omit this and let Vercel infer it from
route.src. - team
Id String - The ID of the team the project exists under. Required when configuring a team resource if a default team has not been set in the provider.
Supporting Types
ProjectRoutePosition, ProjectRoutePositionArgs
- Placement string
- Where to place the rule. One of
start,end,before, orafter. - Reference
Route stringId - The existing route ID to place this rule before or after.
- Placement string
- Where to place the rule. One of
start,end,before, orafter. - Reference
Route stringId - The existing route ID to place this rule before or after.
- placement string
- Where to place the rule. One of
start,end,before, orafter. - reference_
route_ stringid - The existing route ID to place this rule before or after.
- placement String
- Where to place the rule. One of
start,end,before, orafter. - reference
Route StringId - The existing route ID to place this rule before or after.
- placement string
- Where to place the rule. One of
start,end,before, orafter. - reference
Route stringId - The existing route ID to place this rule before or after.
- placement str
- Where to place the rule. One of
start,end,before, orafter. - reference_
route_ strid - The existing route ID to place this rule before or after.
- placement String
- Where to place the rule. One of
start,end,before, orafter. - reference
Route StringId - The existing route ID to place this rule before or after.
ProjectRouteRoute, ProjectRouteRouteArgs
- Src string
- The source pattern to match.
- Case
Sensitive bool - Whether the
srcmatcher is case-sensitive. - Dest string
- The destination for rewrites or redirects.
- Has
List<Pulumiverse.
Vercel. Inputs. Project Route Route Ha> - Conditions that must be present for the rule to match.
- Headers Dictionary<string, string>
- Headers to set for the matched request.
- Missings
List<Pulumiverse.
Vercel. Inputs. Project Route Route Missing> - Conditions that must be absent for the rule to match.
- Respect
Origin boolCache Control - Whether the rule should respect cache control headers from the origin.
- Status int
- The HTTP status code to set for redirects or status-only rules.
- Transforms
List<Pulumiverse.
Vercel. Inputs. Project Route Route Transform> - Transforms applied to the request or response when the rule matches.
- Src string
- The source pattern to match.
- Case
Sensitive bool - Whether the
srcmatcher is case-sensitive. - Dest string
- The destination for rewrites or redirects.
- Has
[]Project
Route Route Ha - Conditions that must be present for the rule to match.
- Headers map[string]string
- Headers to set for the matched request.
- Missings
[]Project
Route Route Missing - Conditions that must be absent for the rule to match.
- Respect
Origin boolCache Control - Whether the rule should respect cache control headers from the origin.
- Status int
- The HTTP status code to set for redirects or status-only rules.
- Transforms
[]Project
Route Route Transform - Transforms applied to the request or response when the rule matches.
- src string
- The source pattern to match.
- case_
sensitive bool - Whether the
srcmatcher is case-sensitive. - dest string
- The destination for rewrites or redirects.
- has list(object)
- Conditions that must be present for the rule to match.
- headers map(string)
- Headers to set for the matched request.
- missings list(object)
- Conditions that must be absent for the rule to match.
- respect_
origin_ boolcache_ control - Whether the rule should respect cache control headers from the origin.
- status number
- The HTTP status code to set for redirects or status-only rules.
- transforms list(object)
- Transforms applied to the request or response when the rule matches.
- src String
- The source pattern to match.
- case
Sensitive Boolean - Whether the
srcmatcher is case-sensitive. - dest String
- The destination for rewrites or redirects.
- has
List<Project
Route Route Ha> - Conditions that must be present for the rule to match.
- headers Map<String,String>
- Headers to set for the matched request.
- missings
List<Project
Route Route Missing> - Conditions that must be absent for the rule to match.
- respect
Origin BooleanCache Control - Whether the rule should respect cache control headers from the origin.
- status Integer
- The HTTP status code to set for redirects or status-only rules.
- transforms
List<Project
Route Route Transform> - Transforms applied to the request or response when the rule matches.
- src string
- The source pattern to match.
- case
Sensitive boolean - Whether the
srcmatcher is case-sensitive. - dest string
- The destination for rewrites or redirects.
- has
Project
Route Route Ha[] - Conditions that must be present for the rule to match.
- headers {[key: string]: string}
- Headers to set for the matched request.
- missings
Project
Route Route Missing[] - Conditions that must be absent for the rule to match.
- respect
Origin booleanCache Control - Whether the rule should respect cache control headers from the origin.
- status number
- The HTTP status code to set for redirects or status-only rules.
- transforms
Project
Route Route Transform[] - Transforms applied to the request or response when the rule matches.
- src str
- The source pattern to match.
- case_
sensitive bool - Whether the
srcmatcher is case-sensitive. - dest str
- The destination for rewrites or redirects.
- has
Sequence[Project
Route Route Ha] - Conditions that must be present for the rule to match.
- headers Mapping[str, str]
- Headers to set for the matched request.
- missings
Sequence[Project
Route Route Missing] - Conditions that must be absent for the rule to match.
- respect_
origin_ boolcache_ control - Whether the rule should respect cache control headers from the origin.
- status int
- The HTTP status code to set for redirects or status-only rules.
- transforms
Sequence[Project
Route Route Transform] - Transforms applied to the request or response when the rule matches.
- src String
- The source pattern to match.
- case
Sensitive Boolean - Whether the
srcmatcher is case-sensitive. - dest String
- The destination for rewrites or redirects.
- has List<Property Map>
- Conditions that must be present for the rule to match.
- headers Map<String>
- Headers to set for the matched request.
- missings List<Property Map>
- Conditions that must be absent for the rule to match.
- respect
Origin BooleanCache Control - Whether the rule should respect cache control headers from the origin.
- status Number
- The HTTP status code to set for redirects or status-only rules.
- transforms List<Property Map>
- Transforms applied to the request or response when the rule matches.
ProjectRouteRouteHa, ProjectRouteRouteHaArgs
ProjectRouteRouteMissing, ProjectRouteRouteMissingArgs
ProjectRouteRouteTransform, ProjectRouteRouteTransformArgs
- Op string
- The transform operation. One of
append,set, ordelete. - Type string
- The transform target. One of
request.headers,request.query, orresponse.headers. - Args string
- A JSON document containing transform arguments. Prefer
jsonencode(...)when setting this. - Envs List<string>
- Environment names that gate this transform.
- Target string
- A JSON document describing the transform target. Prefer
jsonencode(...)when setting this.
- Op string
- The transform operation. One of
append,set, ordelete. - Type string
- The transform target. One of
request.headers,request.query, orresponse.headers. - Args string
- A JSON document containing transform arguments. Prefer
jsonencode(...)when setting this. - Envs []string
- Environment names that gate this transform.
- Target string
- A JSON document describing the transform target. Prefer
jsonencode(...)when setting this.
- op string
- The transform operation. One of
append,set, ordelete. - type string
- The transform target. One of
request.headers,request.query, orresponse.headers. - args string
- A JSON document containing transform arguments. Prefer
jsonencode(...)when setting this. - envs list(string)
- Environment names that gate this transform.
- target string
- A JSON document describing the transform target. Prefer
jsonencode(...)when setting this.
- op String
- The transform operation. One of
append,set, ordelete. - type String
- The transform target. One of
request.headers,request.query, orresponse.headers. - args String
- A JSON document containing transform arguments. Prefer
jsonencode(...)when setting this. - envs List<String>
- Environment names that gate this transform.
- target String
- A JSON document describing the transform target. Prefer
jsonencode(...)when setting this.
- op string
- The transform operation. One of
append,set, ordelete. - type string
- The transform target. One of
request.headers,request.query, orresponse.headers. - args string
- A JSON document containing transform arguments. Prefer
jsonencode(...)when setting this. - envs string[]
- Environment names that gate this transform.
- target string
- A JSON document describing the transform target. Prefer
jsonencode(...)when setting this.
- op str
- The transform operation. One of
append,set, ordelete. - type str
- The transform target. One of
request.headers,request.query, orresponse.headers. - args str
- A JSON document containing transform arguments. Prefer
jsonencode(...)when setting this. - envs Sequence[str]
- Environment names that gate this transform.
- target str
- A JSON document describing the transform target. Prefer
jsonencode(...)when setting this.
- op String
- The transform operation. One of
append,set, ordelete. - type String
- The transform target. One of
request.headers,request.query, orresponse.headers. - args String
- A JSON document containing transform arguments. Prefer
jsonencode(...)when setting this. - envs List<String>
- Environment names that gate this transform.
- target String
- A JSON document describing the transform target. Prefer
jsonencode(...)when setting this.
Import
The pulumi import command can be used, for example:
If importing with a team configured on the provider, use the project ID and route ID.
- project_id can be found in the project
settingstab in the Vercel UI. - route_id can be read from
data.vercel_project_routesor the Vercel routing-rules API.
$ pulumi import vercel:index/projectRoute:ProjectRoute example prj_xxxxxxxxxxxxxxxxxxxxxxxxxxxx/rt_xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Alternatively, you can import via the team_id, project_id, and route_id.
- team_id can be found in the team
settingstab in the Vercel UI. - project_id can be found in the project
settingstab in the Vercel UI. - route_id can be read from
data.vercel_project_routesor the Vercel routing-rules API.
$ pulumi import vercel:index/projectRoute:ProjectRoute example team_xxxxxxxxxxxxxxxxxxxxxxxx/prj_xxxxxxxxxxxxxxxxxxxxxxxxxxxx/rt_xxxxxxxxxxxxxxxxxxxxxxxxxxxx
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- vercel pulumiverse/pulumi-vercel
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
vercelTerraform Provider.
published on Wednesday, Jul 1, 2026 by Pulumiverse