1. Packages
  2. Vercel Provider
  3. API Docs
  4. getCustomEnvironment
Vercel v3.2.1 published on Wednesday, May 14, 2025 by Pulumiverse

vercel.getCustomEnvironment

Explore with Pulumi AI

vercel logo
Vercel v3.2.1 published on Wednesday, May 14, 2025 by Pulumiverse

    Provides information about an existing CustomEnvironment resource.

    An CustomEnvironment allows a vercel.Deployment to be accessed through a different URL.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as vercel from "@pulumi/vercel";
    
    const example = vercel.getProject({
        name: "example-project-with-custom-env",
    });
    const exampleGetCustomEnvironment = example.then(example => vercel.getCustomEnvironment({
        projectId: example.id,
        name: "example-custom-env",
    }));
    
    import pulumi
    import pulumi_vercel as vercel
    
    example = vercel.get_project(name="example-project-with-custom-env")
    example_get_custom_environment = vercel.get_custom_environment(project_id=example.id,
        name="example-custom-env")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-vercel/sdk/v3/go/vercel"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := vercel.LookupProject(ctx, &vercel.LookupProjectArgs{
    			Name: "example-project-with-custom-env",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = vercel.LookupCustomEnvironment(ctx, &vercel.LookupCustomEnvironmentArgs{
    			ProjectId: example.Id,
    			Name:      "example-custom-env",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vercel = Pulumi.Vercel;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Vercel.GetProject.Invoke(new()
        {
            Name = "example-project-with-custom-env",
        });
    
        var exampleGetCustomEnvironment = Vercel.GetCustomEnvironment.Invoke(new()
        {
            ProjectId = example.Apply(getProjectResult => getProjectResult.Id),
            Name = "example-custom-env",
        });
    
    });
    
    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.GetCustomEnvironmentArgs;
    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-with-custom-env")
                .build());
    
            final var exampleGetCustomEnvironment = VercelFunctions.getCustomEnvironment(GetCustomEnvironmentArgs.builder()
                .projectId(example.applyValue(getProjectResult -> getProjectResult.id()))
                .name("example-custom-env")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: vercel:getProject
          Arguments:
            name: example-project-with-custom-env
      exampleGetCustomEnvironment:
        fn::invoke:
          Function: vercel:getCustomEnvironment
          Arguments:
            projectId: ${example.id}
            name: example-custom-env
    

    Using getCustomEnvironment

    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 getCustomEnvironment(args: GetCustomEnvironmentArgs, opts?: InvokeOptions): Promise<GetCustomEnvironmentResult>
    function getCustomEnvironmentOutput(args: GetCustomEnvironmentOutputArgs, opts?: InvokeOptions): Output<GetCustomEnvironmentResult>
    def get_custom_environment(name: Optional[str] = None,
                               project_id: Optional[str] = None,
                               team_id: Optional[str] = None,
                               opts: Optional[InvokeOptions] = None) -> GetCustomEnvironmentResult
    def get_custom_environment_output(name: Optional[pulumi.Input[str]] = None,
                               project_id: Optional[pulumi.Input[str]] = None,
                               team_id: Optional[pulumi.Input[str]] = None,
                               opts: Optional[InvokeOptions] = None) -> Output[GetCustomEnvironmentResult]
    func LookupCustomEnvironment(ctx *Context, args *LookupCustomEnvironmentArgs, opts ...InvokeOption) (*LookupCustomEnvironmentResult, error)
    func LookupCustomEnvironmentOutput(ctx *Context, args *LookupCustomEnvironmentOutputArgs, opts ...InvokeOption) LookupCustomEnvironmentResultOutput

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

    public static class GetCustomEnvironment 
    {
        public static Task<GetCustomEnvironmentResult> InvokeAsync(GetCustomEnvironmentArgs args, InvokeOptions? opts = null)
        public static Output<GetCustomEnvironmentResult> Invoke(GetCustomEnvironmentInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetCustomEnvironmentResult> getCustomEnvironment(GetCustomEnvironmentArgs args, InvokeOptions options)
    public static Output<GetCustomEnvironmentResult> getCustomEnvironment(GetCustomEnvironmentArgs args, InvokeOptions options)
    
    fn::invoke:
      function: vercel:index/getCustomEnvironment:getCustomEnvironment
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    The name of the environment.
    ProjectId string
    The ID of the existing Vercel Project.
    TeamId 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.
    Name string
    The name of the environment.
    ProjectId string
    The ID of the existing Vercel Project.
    TeamId 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.
    name String
    The name of the environment.
    projectId String
    The ID of the existing Vercel Project.
    teamId 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.
    name string
    The name of the environment.
    projectId string
    The ID of the existing Vercel Project.
    teamId 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.
    name str
    The name of the environment.
    project_id str
    The ID of the existing Vercel Project.
    team_id str
    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.
    name String
    The name of the environment.
    projectId String
    The ID of the existing Vercel Project.
    teamId 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.

    getCustomEnvironment Result

    The following output properties are available:

    BranchTracking Pulumiverse.Vercel.Outputs.GetCustomEnvironmentBranchTracking
    The branch tracking configuration for the environment. When enabled, each qualifying merge will generate a deployment.
    Description string
    A description of what the environment is.
    Id string
    The ID of the environment.
    Name string
    The name of the environment.
    ProjectId string
    The ID of the existing Vercel Project.
    TeamId 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.
    BranchTracking GetCustomEnvironmentBranchTracking
    The branch tracking configuration for the environment. When enabled, each qualifying merge will generate a deployment.
    Description string
    A description of what the environment is.
    Id string
    The ID of the environment.
    Name string
    The name of the environment.
    ProjectId string
    The ID of the existing Vercel Project.
    TeamId 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.
    branchTracking GetCustomEnvironmentBranchTracking
    The branch tracking configuration for the environment. When enabled, each qualifying merge will generate a deployment.
    description String
    A description of what the environment is.
    id String
    The ID of the environment.
    name String
    The name of the environment.
    projectId String
    The ID of the existing Vercel Project.
    teamId 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.
    branchTracking GetCustomEnvironmentBranchTracking
    The branch tracking configuration for the environment. When enabled, each qualifying merge will generate a deployment.
    description string
    A description of what the environment is.
    id string
    The ID of the environment.
    name string
    The name of the environment.
    projectId string
    The ID of the existing Vercel Project.
    teamId 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.
    branch_tracking GetCustomEnvironmentBranchTracking
    The branch tracking configuration for the environment. When enabled, each qualifying merge will generate a deployment.
    description str
    A description of what the environment is.
    id str
    The ID of the environment.
    name str
    The name of the environment.
    project_id str
    The ID of the existing Vercel Project.
    team_id str
    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.
    branchTracking Property Map
    The branch tracking configuration for the environment. When enabled, each qualifying merge will generate a deployment.
    description String
    A description of what the environment is.
    id String
    The ID of the environment.
    name String
    The name of the environment.
    projectId String
    The ID of the existing Vercel Project.
    teamId 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.

    Supporting Types

    GetCustomEnvironmentBranchTracking

    Pattern string
    The pattern of the branch name to track.
    Type string
    How a branch name should be matched against the pattern. Must be one of 'startsWith', 'endsWith' or 'equals'.
    Pattern string
    The pattern of the branch name to track.
    Type string
    How a branch name should be matched against the pattern. Must be one of 'startsWith', 'endsWith' or 'equals'.
    pattern String
    The pattern of the branch name to track.
    type String
    How a branch name should be matched against the pattern. Must be one of 'startsWith', 'endsWith' or 'equals'.
    pattern string
    The pattern of the branch name to track.
    type string
    How a branch name should be matched against the pattern. Must be one of 'startsWith', 'endsWith' or 'equals'.
    pattern str
    The pattern of the branch name to track.
    type str
    How a branch name should be matched against the pattern. Must be one of 'startsWith', 'endsWith' or 'equals'.
    pattern String
    The pattern of the branch name to track.
    type String
    How a branch name should be matched against the pattern. Must be one of 'startsWith', 'endsWith' or 'equals'.

    Package Details

    Repository
    vercel pulumiverse/pulumi-vercel
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the vercel Terraform Provider.
    vercel logo
    Vercel v3.2.1 published on Wednesday, May 14, 2025 by Pulumiverse