1. Packages
  2. Packages
  3. Vercel Provider
  4. API Docs
  5. getProjectRoutes
Viewing docs for Vercel v5.4.1
published on Wednesday, Jul 22, 2026 by Pulumiverse
vercel logo
Viewing docs for Vercel v5.4.1
published on Wednesday, Jul 22, 2026 by Pulumiverse

    Provides information about the live project routing rules configured for a Vercel project.

    This data source intentionally reads the current live version and ignores unpublished staged drafts.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as vercel from "@pulumiverse/vercel";
    
    const example = vercel.getProject({
        name: "example-project",
    });
    const exampleGetProjectRoutes = example.then(example => vercel.getProjectRoutes({
        projectId: example.id,
    }));
    
    import pulumi
    import pulumi_vercel as vercel
    
    example = vercel.get_project(name="example-project")
    example_get_project_routes = vercel.get_project_routes(project_id=example.id)
    
    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.LookupProject(ctx, &vercel.LookupProjectArgs{
    			Name: "example-project",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = vercel.GetProjectRoutes(ctx, &vercel.GetProjectRoutesArgs{
    			ProjectId: example.Id,
    		}, nil)
    		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 = Vercel.GetProject.Invoke(new()
        {
            Name = "example-project",
        });
    
        var exampleGetProjectRoutes = Vercel.GetProjectRoutes.Invoke(new()
        {
            ProjectId = example.Apply(getProjectResult => getProjectResult.Id),
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vercel.VercelFunctions;
    import com.pulumi.vercel.inputs.GetProjectArgs;
    import com.pulumi.vercel.inputs.GetProjectRoutesArgs;
    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) {
            final var example = VercelFunctions.getProject(GetProjectArgs.builder()
                .name("example-project")
                .build());
    
            final var exampleGetProjectRoutes = VercelFunctions.getProjectRoutes(GetProjectRoutesArgs.builder()
                .projectId(example.id())
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: vercel:getProject
          arguments:
            name: example-project
      exampleGetProjectRoutes:
        fn::invoke:
          function: vercel:getProjectRoutes
          arguments:
            projectId: ${example.id}
    
    Example coming soon!
    

    Using getProjectRoutes

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getProjectRoutes(args: GetProjectRoutesArgs, opts?: InvokeOptions): Promise<GetProjectRoutesResult>
    function getProjectRoutesOutput(args: GetProjectRoutesOutputArgs, opts?: InvokeOptions): Output<GetProjectRoutesResult>
    def get_project_routes(project_id: Optional[str] = None,
                           team_id: Optional[str] = None,
                           opts: Optional[InvokeOptions] = None) -> GetProjectRoutesResult
    def get_project_routes_output(project_id: pulumi.Input[Optional[str]] = None,
                           team_id: pulumi.Input[Optional[str]] = None,
                           opts: Optional[InvokeOptions] = None) -> Output[GetProjectRoutesResult]
    func GetProjectRoutes(ctx *Context, args *GetProjectRoutesArgs, opts ...InvokeOption) (*GetProjectRoutesResult, error)
    func GetProjectRoutesOutput(ctx *Context, args *GetProjectRoutesOutputArgs, opts ...InvokeOption) GetProjectRoutesResultOutput

    > Note: This function is named GetProjectRoutes in the Go SDK.

    public static class GetProjectRoutes 
    {
        public static Task<GetProjectRoutesResult> InvokeAsync(GetProjectRoutesArgs args, InvokeOptions? opts = null)
        public static Output<GetProjectRoutesResult> Invoke(GetProjectRoutesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetProjectRoutesResult> getProjectRoutes(GetProjectRoutesArgs args, InvokeOptions options)
    public static Output<GetProjectRoutesResult> getProjectRoutes(GetProjectRoutesArgs args, InvokeOptions options)
    
    fn::invoke:
      function: vercel:index/getProjectRoutes:getProjectRoutes
      arguments:
        # arguments dictionary
    data "vercel_get_project_routes" "name" {
        # arguments
    }

    The following arguments are supported:

    ProjectId string
    The ID of the project to read routing rules for.
    TeamId 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.
    ProjectId string
    The ID of the project to read routing rules for.
    TeamId 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 read routing rules for.
    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.
    projectId String
    The ID of the project to read routing rules for.
    teamId 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.
    projectId string
    The ID of the project to read routing rules for.
    teamId 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 read routing rules for.
    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.
    projectId String
    The ID of the project to read routing rules for.
    teamId 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.

    getProjectRoutes Result

    The following output properties are available:

    Id string
    The unique identifier for this data source. Format: teamid/projectid or project_id for personal accounts.
    ProjectId string
    The ID of the project to read routing rules for.
    Rules List<Pulumiverse.Vercel.Outputs.GetProjectRoutesRule>
    The ordered list of live routing rules for the project.
    TeamId 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.
    Id string
    The unique identifier for this data source. Format: teamid/projectid or project_id for personal accounts.
    ProjectId string
    The ID of the project to read routing rules for.
    Rules []GetProjectRoutesRule
    The ordered list of live routing rules for the project.
    TeamId 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.
    id string
    The unique identifier for this data source. Format: teamid/projectid or project_id for personal accounts.
    project_id string
    The ID of the project to read routing rules for.
    rules list(object)
    The ordered list of live routing rules for the project.
    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.
    id String
    The unique identifier for this data source. Format: teamid/projectid or project_id for personal accounts.
    projectId String
    The ID of the project to read routing rules for.
    rules List<GetProjectRoutesRule>
    The ordered list of live routing rules for the project.
    teamId 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.
    id string
    The unique identifier for this data source. Format: teamid/projectid or project_id for personal accounts.
    projectId string
    The ID of the project to read routing rules for.
    rules GetProjectRoutesRule[]
    The ordered list of live routing rules for the project.
    teamId 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.
    id str
    The unique identifier for this data source. Format: teamid/projectid or project_id for personal accounts.
    project_id str
    The ID of the project to read routing rules for.
    rules Sequence[GetProjectRoutesRule]
    The ordered list of live routing rules for the project.
    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.
    id String
    The unique identifier for this data source. Format: teamid/projectid or project_id for personal accounts.
    projectId String
    The ID of the project to read routing rules for.
    rules List<Property Map>
    The ordered list of live routing rules for the project.
    teamId 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

    GetProjectRoutesRule

    Description string
    An optional description of the rule.
    Enabled bool
    Whether the rule is enabled.
    Id string
    The rule ID managed by Vercel.
    Name string
    A human-readable name for the rule.
    Route Pulumiverse.Vercel.Inputs.GetProjectRoutesRuleRoute
    The routing rule definition.
    RouteType string
    The computed route type returned by Vercel. One of rewrite, redirect, set_status, or transform.
    SrcSyntax string
    The source pattern syntax inferred or stored by Vercel.
    Description string
    An optional description of the rule.
    Enabled bool
    Whether the rule is enabled.
    Id string
    The rule ID managed by Vercel.
    Name string
    A human-readable name for the rule.
    Route GetProjectRoutesRuleRoute
    The routing rule definition.
    RouteType string
    The computed route type returned by Vercel. One of rewrite, redirect, set_status, or transform.
    SrcSyntax string
    The source pattern syntax inferred or stored by Vercel.
    description string
    An optional description of the rule.
    enabled bool
    Whether the rule is enabled.
    id string
    The rule ID managed by Vercel.
    name string
    A human-readable name for the rule.
    route object
    The routing rule definition.
    route_type string
    The computed route type returned by Vercel. One of rewrite, redirect, set_status, or transform.
    src_syntax string
    The source pattern syntax inferred or stored by Vercel.
    description String
    An optional description of the rule.
    enabled Boolean
    Whether the rule is enabled.
    id String
    The rule ID managed by Vercel.
    name String
    A human-readable name for the rule.
    route GetProjectRoutesRuleRoute
    The routing rule definition.
    routeType String
    The computed route type returned by Vercel. One of rewrite, redirect, set_status, or transform.
    srcSyntax String
    The source pattern syntax inferred or stored by Vercel.
    description string
    An optional description of the rule.
    enabled boolean
    Whether the rule is enabled.
    id string
    The rule ID managed by Vercel.
    name string
    A human-readable name for the rule.
    route GetProjectRoutesRuleRoute
    The routing rule definition.
    routeType string
    The computed route type returned by Vercel. One of rewrite, redirect, set_status, or transform.
    srcSyntax string
    The source pattern syntax inferred or stored by Vercel.
    description str
    An optional description of the rule.
    enabled bool
    Whether the rule is enabled.
    id str
    The rule ID managed by Vercel.
    name str
    A human-readable name for the rule.
    route GetProjectRoutesRuleRoute
    The routing rule definition.
    route_type str
    The computed route type returned by Vercel. One of rewrite, redirect, set_status, or transform.
    src_syntax str
    The source pattern syntax inferred or stored by Vercel.
    description String
    An optional description of the rule.
    enabled Boolean
    Whether the rule is enabled.
    id String
    The rule ID managed by Vercel.
    name String
    A human-readable name for the rule.
    route Property Map
    The routing rule definition.
    routeType String
    The computed route type returned by Vercel. One of rewrite, redirect, set_status, or transform.
    srcSyntax String
    The source pattern syntax inferred or stored by Vercel.

    GetProjectRoutesRuleRoute

    CaseSensitive bool
    Whether the src matcher is case-sensitive.
    Dest string
    The destination for rewrites or redirects.
    Has List<Pulumiverse.Vercel.Inputs.GetProjectRoutesRuleRouteHa>
    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.GetProjectRoutesRuleRouteMissing>
    Conditions that must be absent for the rule to match.
    RespectOriginCacheControl bool
    Whether the rule should respect cache control headers from the origin.
    Src string
    The source pattern to match.
    Status int
    The HTTP status code to set for redirects or status-only rules.
    Transforms List<Pulumiverse.Vercel.Inputs.GetProjectRoutesRuleRouteTransform>
    Transforms applied to the request or response when the rule matches.
    CaseSensitive bool
    Whether the src matcher is case-sensitive.
    Dest string
    The destination for rewrites or redirects.
    Has []GetProjectRoutesRuleRouteHa
    Conditions that must be present for the rule to match.
    Headers map[string]string
    Headers to set for the matched request.
    Missings []GetProjectRoutesRuleRouteMissing
    Conditions that must be absent for the rule to match.
    RespectOriginCacheControl bool
    Whether the rule should respect cache control headers from the origin.
    Src string
    The source pattern to match.
    Status int
    The HTTP status code to set for redirects or status-only rules.
    Transforms []GetProjectRoutesRuleRouteTransform
    Transforms applied to the request or response when the rule matches.
    case_sensitive bool
    Whether the src matcher 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_cache_control bool
    Whether the rule should respect cache control headers from the origin.
    src string
    The source pattern to match.
    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.
    caseSensitive Boolean
    Whether the src matcher is case-sensitive.
    dest String
    The destination for rewrites or redirects.
    has List<GetProjectRoutesRuleRouteHa>
    Conditions that must be present for the rule to match.
    headers Map<String,String>
    Headers to set for the matched request.
    missings List<GetProjectRoutesRuleRouteMissing>
    Conditions that must be absent for the rule to match.
    respectOriginCacheControl Boolean
    Whether the rule should respect cache control headers from the origin.
    src String
    The source pattern to match.
    status Integer
    The HTTP status code to set for redirects or status-only rules.
    transforms List<GetProjectRoutesRuleRouteTransform>
    Transforms applied to the request or response when the rule matches.
    caseSensitive boolean
    Whether the src matcher is case-sensitive.
    dest string
    The destination for rewrites or redirects.
    has GetProjectRoutesRuleRouteHa[]
    Conditions that must be present for the rule to match.
    headers {[key: string]: string}
    Headers to set for the matched request.
    missings GetProjectRoutesRuleRouteMissing[]
    Conditions that must be absent for the rule to match.
    respectOriginCacheControl boolean
    Whether the rule should respect cache control headers from the origin.
    src string
    The source pattern to match.
    status number
    The HTTP status code to set for redirects or status-only rules.
    transforms GetProjectRoutesRuleRouteTransform[]
    Transforms applied to the request or response when the rule matches.
    case_sensitive bool
    Whether the src matcher is case-sensitive.
    dest str
    The destination for rewrites or redirects.
    has Sequence[GetProjectRoutesRuleRouteHa]
    Conditions that must be present for the rule to match.
    headers Mapping[str, str]
    Headers to set for the matched request.
    missings Sequence[GetProjectRoutesRuleRouteMissing]
    Conditions that must be absent for the rule to match.
    respect_origin_cache_control bool
    Whether the rule should respect cache control headers from the origin.
    src str
    The source pattern to match.
    status int
    The HTTP status code to set for redirects or status-only rules.
    transforms Sequence[GetProjectRoutesRuleRouteTransform]
    Transforms applied to the request or response when the rule matches.
    caseSensitive Boolean
    Whether the src matcher 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.
    respectOriginCacheControl Boolean
    Whether the rule should respect cache control headers from the origin.
    src String
    The source pattern to match.
    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.

    GetProjectRoutesRuleRouteHa

    Key string
    Type string
    Value string
    Key string
    Type string
    Value string
    key string
    type string
    value string
    key String
    type String
    value String
    key string
    type string
    value string
    key str
    type str
    value str
    key String
    type String
    value String

    GetProjectRoutesRuleRouteMissing

    Key string
    Type string
    Value string
    Key string
    Type string
    Value string
    key string
    type string
    value string
    key String
    type String
    value String
    key string
    type string
    value string
    key str
    type str
    value str
    key String
    type String
    value String

    GetProjectRoutesRuleRouteTransform

    Args string
    Envs List<string>
    Op string
    Target string
    Type string
    Args string
    Envs []string
    Op string
    Target string
    Type string
    args string
    envs list(string)
    op string
    target string
    type string
    args String
    envs List<String>
    op String
    target String
    type String
    args string
    envs string[]
    op string
    target string
    type string
    args str
    envs Sequence[str]
    op str
    target str
    type str
    args String
    envs List<String>
    op String
    target String
    type String

    Package Details

    Repository
    vercel pulumiverse/pulumi-vercel
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the vercel Terraform Provider.
    vercel logo
    Viewing docs for Vercel v5.4.1
    published on Wednesday, Jul 22, 2026 by Pulumiverse

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial