1. Packages
  2. Vercel Provider
  3. API Docs
  4. ProjectEnvironmentVariable
Vercel v4.6.0 published on Thursday, Feb 12, 2026 by Pulumiverse
vercel logo
Vercel v4.6.0 published on Thursday, Feb 12, 2026 by Pulumiverse

    Example Usage

    Create ProjectEnvironmentVariable Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new ProjectEnvironmentVariable(name: string, args: ProjectEnvironmentVariableArgs, opts?: CustomResourceOptions);
    @overload
    def ProjectEnvironmentVariable(resource_name: str,
                                   args: ProjectEnvironmentVariableArgs,
                                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def ProjectEnvironmentVariable(resource_name: str,
                                   opts: Optional[ResourceOptions] = None,
                                   key: Optional[str] = None,
                                   project_id: Optional[str] = None,
                                   comment: Optional[str] = None,
                                   custom_environment_ids: Optional[Sequence[str]] = None,
                                   git_branch: Optional[str] = None,
                                   sensitive: Optional[bool] = None,
                                   targets: Optional[Sequence[str]] = None,
                                   team_id: Optional[str] = None,
                                   value: Optional[str] = None,
                                   value_wo: Optional[str] = None)
    func NewProjectEnvironmentVariable(ctx *Context, name string, args ProjectEnvironmentVariableArgs, opts ...ResourceOption) (*ProjectEnvironmentVariable, error)
    public ProjectEnvironmentVariable(string name, ProjectEnvironmentVariableArgs args, CustomResourceOptions? opts = null)
    public ProjectEnvironmentVariable(String name, ProjectEnvironmentVariableArgs args)
    public ProjectEnvironmentVariable(String name, ProjectEnvironmentVariableArgs args, CustomResourceOptions options)
    
    type: vercel:ProjectEnvironmentVariable
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args ProjectEnvironmentVariableArgs
    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 ProjectEnvironmentVariableArgs
    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 ProjectEnvironmentVariableArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ProjectEnvironmentVariableArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ProjectEnvironmentVariableArgs
    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 projectEnvironmentVariableResource = new Vercel.ProjectEnvironmentVariable("projectEnvironmentVariableResource", new()
    {
        Key = "string",
        ProjectId = "string",
        Comment = "string",
        CustomEnvironmentIds = new[]
        {
            "string",
        },
        GitBranch = "string",
        Sensitive = false,
        Targets = new[]
        {
            "string",
        },
        TeamId = "string",
        Value = "string",
        ValueWo = "string",
    });
    
    example, err := vercel.NewProjectEnvironmentVariable(ctx, "projectEnvironmentVariableResource", &vercel.ProjectEnvironmentVariableArgs{
    	Key:       pulumi.String("string"),
    	ProjectId: pulumi.String("string"),
    	Comment:   pulumi.String("string"),
    	CustomEnvironmentIds: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	GitBranch: pulumi.String("string"),
    	Sensitive: pulumi.Bool(false),
    	Targets: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	TeamId:  pulumi.String("string"),
    	Value:   pulumi.String("string"),
    	ValueWo: pulumi.String("string"),
    })
    
    var projectEnvironmentVariableResource = new ProjectEnvironmentVariable("projectEnvironmentVariableResource", ProjectEnvironmentVariableArgs.builder()
        .key("string")
        .projectId("string")
        .comment("string")
        .customEnvironmentIds("string")
        .gitBranch("string")
        .sensitive(false)
        .targets("string")
        .teamId("string")
        .value("string")
        .valueWo("string")
        .build());
    
    project_environment_variable_resource = vercel.ProjectEnvironmentVariable("projectEnvironmentVariableResource",
        key="string",
        project_id="string",
        comment="string",
        custom_environment_ids=["string"],
        git_branch="string",
        sensitive=False,
        targets=["string"],
        team_id="string",
        value="string",
        value_wo="string")
    
    const projectEnvironmentVariableResource = new vercel.ProjectEnvironmentVariable("projectEnvironmentVariableResource", {
        key: "string",
        projectId: "string",
        comment: "string",
        customEnvironmentIds: ["string"],
        gitBranch: "string",
        sensitive: false,
        targets: ["string"],
        teamId: "string",
        value: "string",
        valueWo: "string",
    });
    
    type: vercel:ProjectEnvironmentVariable
    properties:
        comment: string
        customEnvironmentIds:
            - string
        gitBranch: string
        key: string
        projectId: string
        sensitive: false
        targets:
            - string
        teamId: string
        value: string
        valueWo: string
    

    ProjectEnvironmentVariable 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 ProjectEnvironmentVariable resource accepts the following input properties:

    Key string
    The name of the Environment Variable.
    ProjectId string
    The ID of the Vercel project.
    Comment string
    A comment explaining what the environment variable is for.
    CustomEnvironmentIds List<string>
    The IDs of Custom Environments that the Environment Variable should be present on. At least one of target or custom_environment_ids must be set.
    GitBranch string
    The git branch of the Environment Variable.
    Sensitive bool
    Whether the Environment Variable is sensitive or not. (May be affected by a team-wide environment variable policy)
    Targets List<string>
    The environments that the Environment Variable should be present on. Valid targets are either production, preview, or development. At least one of target or custom_environment_ids must be set.
    TeamId string
    The ID of the Vercel team.Required when configuring a team resource if a default team has not been set in the provider.
    Value string
    (Optional, exactly one of value or value_wo is required) The value of the Environment Variable.
    ValueWo string
    NOTE: This field is write-only and its value will not be updated in state as part of read operations. (Optional, Write-Only, exactly one of value or value_wo is required) The value of the Environment Variable, from an ephemeral resource.
    Key string
    The name of the Environment Variable.
    ProjectId string
    The ID of the Vercel project.
    Comment string
    A comment explaining what the environment variable is for.
    CustomEnvironmentIds []string
    The IDs of Custom Environments that the Environment Variable should be present on. At least one of target or custom_environment_ids must be set.
    GitBranch string
    The git branch of the Environment Variable.
    Sensitive bool
    Whether the Environment Variable is sensitive or not. (May be affected by a team-wide environment variable policy)
    Targets []string
    The environments that the Environment Variable should be present on. Valid targets are either production, preview, or development. At least one of target or custom_environment_ids must be set.
    TeamId string
    The ID of the Vercel team.Required when configuring a team resource if a default team has not been set in the provider.
    Value string
    (Optional, exactly one of value or value_wo is required) The value of the Environment Variable.
    ValueWo string
    NOTE: This field is write-only and its value will not be updated in state as part of read operations. (Optional, Write-Only, exactly one of value or value_wo is required) The value of the Environment Variable, from an ephemeral resource.
    key String
    The name of the Environment Variable.
    projectId String
    The ID of the Vercel project.
    comment String
    A comment explaining what the environment variable is for.
    customEnvironmentIds List<String>
    The IDs of Custom Environments that the Environment Variable should be present on. At least one of target or custom_environment_ids must be set.
    gitBranch 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)
    targets List<String>
    The environments that the Environment Variable should be present on. Valid targets are either production, preview, or development. At least one of target or custom_environment_ids must be set.
    teamId String
    The ID of the Vercel team.Required when configuring a team resource if a default team has not been set in the provider.
    value String
    (Optional, exactly one of value or value_wo is required) The value of the Environment Variable.
    valueWo String
    NOTE: This field is write-only and its value will not be updated in state as part of read operations. (Optional, Write-Only, exactly one of value or value_wo is required) The value of the Environment Variable, from an ephemeral resource.
    key string
    The name of the Environment Variable.
    projectId string
    The ID of the Vercel project.
    comment string
    A comment explaining what the environment variable is for.
    customEnvironmentIds string[]
    The IDs of Custom Environments that the Environment Variable should be present on. At least one of target or custom_environment_ids must be set.
    gitBranch 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)
    targets string[]
    The environments that the Environment Variable should be present on. Valid targets are either production, preview, or development. At least one of target or custom_environment_ids must be set.
    teamId string
    The ID of the Vercel team.Required when configuring a team resource if a default team has not been set in the provider.
    value string
    (Optional, exactly one of value or value_wo is required) The value of the Environment Variable.
    valueWo string
    NOTE: This field is write-only and its value will not be updated in state as part of read operations. (Optional, Write-Only, exactly one of value or value_wo is required) The value of the Environment Variable, from an ephemeral resource.
    key str
    The name of the Environment Variable.
    project_id str
    The ID of the Vercel project.
    comment str
    A comment explaining what the environment variable is for.
    custom_environment_ids Sequence[str]
    The IDs of Custom Environments that the Environment Variable should be present on. At least one of target or custom_environment_ids must be set.
    git_branch str
    The git branch of the Environment Variable.
    sensitive bool
    Whether the Environment Variable is sensitive or not. (May be affected by a team-wide environment variable policy)
    targets Sequence[str]
    The environments that the Environment Variable should be present on. Valid targets are either production, preview, or development. At least one of target or custom_environment_ids must be set.
    team_id str
    The ID of the Vercel team.Required when configuring a team resource if a default team has not been set in the provider.
    value str
    (Optional, exactly one of value or value_wo is required) The value of the Environment Variable.
    value_wo str
    NOTE: This field is write-only and its value will not be updated in state as part of read operations. (Optional, Write-Only, exactly one of value or value_wo is required) The value of the Environment Variable, from an ephemeral resource.
    key String
    The name of the Environment Variable.
    projectId String
    The ID of the Vercel project.
    comment String
    A comment explaining what the environment variable is for.
    customEnvironmentIds List<String>
    The IDs of Custom Environments that the Environment Variable should be present on. At least one of target or custom_environment_ids must be set.
    gitBranch 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)
    targets List<String>
    The environments that the Environment Variable should be present on. Valid targets are either production, preview, or development. At least one of target or custom_environment_ids must be set.
    teamId String
    The ID of the Vercel team.Required when configuring a team resource if a default team has not been set in the provider.
    value String
    (Optional, exactly one of value or value_wo is required) The value of the Environment Variable.
    valueWo String
    NOTE: This field is write-only and its value will not be updated in state as part of read operations. (Optional, Write-Only, exactly one of value or value_wo is required) The value of the Environment Variable, from an ephemeral resource.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ProjectEnvironmentVariable resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing ProjectEnvironmentVariable Resource

    Get an existing ProjectEnvironmentVariable 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?: ProjectEnvironmentVariableState, opts?: CustomResourceOptions): ProjectEnvironmentVariable
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            comment: Optional[str] = None,
            custom_environment_ids: Optional[Sequence[str]] = None,
            git_branch: Optional[str] = None,
            key: Optional[str] = None,
            project_id: Optional[str] = None,
            sensitive: Optional[bool] = None,
            targets: Optional[Sequence[str]] = None,
            team_id: Optional[str] = None,
            value: Optional[str] = None,
            value_wo: Optional[str] = None) -> ProjectEnvironmentVariable
    func GetProjectEnvironmentVariable(ctx *Context, name string, id IDInput, state *ProjectEnvironmentVariableState, opts ...ResourceOption) (*ProjectEnvironmentVariable, error)
    public static ProjectEnvironmentVariable Get(string name, Input<string> id, ProjectEnvironmentVariableState? state, CustomResourceOptions? opts = null)
    public static ProjectEnvironmentVariable get(String name, Output<String> id, ProjectEnvironmentVariableState state, CustomResourceOptions options)
    resources:  _:    type: vercel:ProjectEnvironmentVariable    get:      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.
    The following state arguments are supported:
    Comment string
    A comment explaining what the environment variable is for.
    CustomEnvironmentIds List<string>
    The IDs of Custom Environments that the Environment Variable should be present on. At least one of target or custom_environment_ids must be set.
    GitBranch string
    The git branch of the Environment Variable.
    Key string
    The name of the Environment Variable.
    ProjectId string
    The ID of the Vercel project.
    Sensitive bool
    Whether the Environment Variable is sensitive or not. (May be affected by a team-wide environment variable policy)
    Targets List<string>
    The environments that the Environment Variable should be present on. Valid targets are either production, preview, or development. At least one of target or custom_environment_ids must be set.
    TeamId string
    The ID of the Vercel team.Required when configuring a team resource if a default team has not been set in the provider.
    Value string
    (Optional, exactly one of value or value_wo is required) The value of the Environment Variable.
    ValueWo string
    NOTE: This field is write-only and its value will not be updated in state as part of read operations. (Optional, Write-Only, exactly one of value or value_wo is required) The value of the Environment Variable, from an ephemeral resource.
    Comment string
    A comment explaining what the environment variable is for.
    CustomEnvironmentIds []string
    The IDs of Custom Environments that the Environment Variable should be present on. At least one of target or custom_environment_ids must be set.
    GitBranch string
    The git branch of the Environment Variable.
    Key string
    The name of the Environment Variable.
    ProjectId string
    The ID of the Vercel project.
    Sensitive bool
    Whether the Environment Variable is sensitive or not. (May be affected by a team-wide environment variable policy)
    Targets []string
    The environments that the Environment Variable should be present on. Valid targets are either production, preview, or development. At least one of target or custom_environment_ids must be set.
    TeamId string
    The ID of the Vercel team.Required when configuring a team resource if a default team has not been set in the provider.
    Value string
    (Optional, exactly one of value or value_wo is required) The value of the Environment Variable.
    ValueWo string
    NOTE: This field is write-only and its value will not be updated in state as part of read operations. (Optional, Write-Only, exactly one of value or value_wo is required) The value of the Environment Variable, from an ephemeral resource.
    comment String
    A comment explaining what the environment variable is for.
    customEnvironmentIds List<String>
    The IDs of Custom Environments that the Environment Variable should be present on. At least one of target or custom_environment_ids must be set.
    gitBranch String
    The git branch of the Environment Variable.
    key String
    The name of the Environment Variable.
    projectId String
    The ID of the Vercel project.
    sensitive Boolean
    Whether the Environment Variable is sensitive or not. (May be affected by a team-wide environment variable policy)
    targets List<String>
    The environments that the Environment Variable should be present on. Valid targets are either production, preview, or development. At least one of target or custom_environment_ids must be set.
    teamId String
    The ID of the Vercel team.Required when configuring a team resource if a default team has not been set in the provider.
    value String
    (Optional, exactly one of value or value_wo is required) The value of the Environment Variable.
    valueWo String
    NOTE: This field is write-only and its value will not be updated in state as part of read operations. (Optional, Write-Only, exactly one of value or value_wo is required) The value of the Environment Variable, from an ephemeral resource.
    comment string
    A comment explaining what the environment variable is for.
    customEnvironmentIds string[]
    The IDs of Custom Environments that the Environment Variable should be present on. At least one of target or custom_environment_ids must be set.
    gitBranch string
    The git branch of the Environment Variable.
    key string
    The name of the Environment Variable.
    projectId string
    The ID of the Vercel project.
    sensitive boolean
    Whether the Environment Variable is sensitive or not. (May be affected by a team-wide environment variable policy)
    targets string[]
    The environments that the Environment Variable should be present on. Valid targets are either production, preview, or development. At least one of target or custom_environment_ids must be set.
    teamId string
    The ID of the Vercel team.Required when configuring a team resource if a default team has not been set in the provider.
    value string
    (Optional, exactly one of value or value_wo is required) The value of the Environment Variable.
    valueWo string
    NOTE: This field is write-only and its value will not be updated in state as part of read operations. (Optional, Write-Only, exactly one of value or value_wo is required) The value of the Environment Variable, from an ephemeral resource.
    comment str
    A comment explaining what the environment variable is for.
    custom_environment_ids Sequence[str]
    The IDs of Custom Environments that the Environment Variable should be present on. At least one of target or custom_environment_ids must be set.
    git_branch str
    The git branch of the Environment Variable.
    key str
    The name of the Environment Variable.
    project_id str
    The ID of the Vercel project.
    sensitive bool
    Whether the Environment Variable is sensitive or not. (May be affected by a team-wide environment variable policy)
    targets Sequence[str]
    The environments that the Environment Variable should be present on. Valid targets are either production, preview, or development. At least one of target or custom_environment_ids must be set.
    team_id str
    The ID of the Vercel team.Required when configuring a team resource if a default team has not been set in the provider.
    value str
    (Optional, exactly one of value or value_wo is required) The value of the Environment Variable.
    value_wo str
    NOTE: This field is write-only and its value will not be updated in state as part of read operations. (Optional, Write-Only, exactly one of value or value_wo is required) The value of the Environment Variable, from an ephemeral resource.
    comment String
    A comment explaining what the environment variable is for.
    customEnvironmentIds List<String>
    The IDs of Custom Environments that the Environment Variable should be present on. At least one of target or custom_environment_ids must be set.
    gitBranch String
    The git branch of the Environment Variable.
    key String
    The name of the Environment Variable.
    projectId String
    The ID of the Vercel project.
    sensitive Boolean
    Whether the Environment Variable is sensitive or not. (May be affected by a team-wide environment variable policy)
    targets List<String>
    The environments that the Environment Variable should be present on. Valid targets are either production, preview, or development. At least one of target or custom_environment_ids must be set.
    teamId String
    The ID of the Vercel team.Required when configuring a team resource if a default team has not been set in the provider.
    value String
    (Optional, exactly one of value or value_wo is required) The value of the Environment Variable.
    valueWo String
    NOTE: This field is write-only and its value will not be updated in state as part of read operations. (Optional, Write-Only, exactly one of value or value_wo is required) The value of the Environment Variable, from an ephemeral resource.

    Import

    If importing into a personal account, or with a team configured on

    the provider, simply use the project_id and environment variable id.

    • project_id can be found in the project settings tab in the Vercel UI.

    • environment variable id can be taken from the network tab inside developer tools, while you are on the project page,

    or can be queried from Vercel API directly (https://vercel.com/docs/rest-api/endpoints/projects#retrieve-the-environment-variables-of-a-project-by-id-or-name)

    Note also, that the value field for sensitive environment variables will be imported as null.

    $ pulumi import vercel:index/projectEnvironmentVariable:ProjectEnvironmentVariable example prj_xxxxxxxxxxxxxxxxxxxxxxxxxxxx/FdT2e1E5Of6Cihmt
    

    Alternatively, you can import via the team_id, project_id and

    environment variable 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.

    • environment variable id can be taken from the network tab inside developer tools, while you are on the project page,

    or can be queried from Vercel API directly (https://vercel.com/docs/rest-api/endpoints/projects#retrieve-the-environment-variables-of-a-project-by-id-or-name)

    Note also, that the value field for sensitive environment variables will be imported as null.

    $ pulumi import vercel:index/projectEnvironmentVariable:ProjectEnvironmentVariable example team_xxxxxxxxxxxxxxxxxxxxxxxx/prj_xxxxxxxxxxxxxxxxxxxxxxxxxxxx/FdT2e1E5Of6Cihmt
    

    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 vercel Terraform Provider.
    vercel logo
    Vercel v4.6.0 published on Thursday, Feb 12, 2026 by Pulumiverse
      Meet Neo: Your AI Platform Teammate