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

vercel.ProjectEnvironmentVariables

Explore with Pulumi AI

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

    Example Usage

    Coming soon!
    
    Coming soon!
    
    Coming soon!
    
    Coming soon!
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vercel.Project;
    import com.pulumi.vercel.ProjectArgs;
    import com.pulumi.vercel.inputs.ProjectGitRepositoryArgs;
    import com.pulumi.vercel.ProjectEnvironmentVariables;
    import com.pulumi.vercel.ProjectEnvironmentVariablesArgs;
    import com.pulumi.vercel.inputs.ProjectEnvironmentVariablesVariableArgs;
    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")
                .gitRepository(ProjectGitRepositoryArgs.builder()
                    .type("github")
                    .repo("vercel/some-repo")
                    .build())
                .build());
    
            var exampleProjectEnvironmentVariables = new ProjectEnvironmentVariables("exampleProjectEnvironmentVariables", ProjectEnvironmentVariablesArgs.builder()
                .projectId(test.id())
                .variables(            
                    ProjectEnvironmentVariablesVariableArgs.builder()
                        .key("SOME_VARIABLE")
                        .value("some_value")
                        .target(                    
                            "production",
                            "preview")
                        .build(),
                    ProjectEnvironmentVariablesVariableArgs.builder()
                        .key("ANOTHER_VARIABLE")
                        .value("another_value")
                        .git_branch("staging")
                        .target("preview")
                        .build(),
                    ProjectEnvironmentVariablesVariableArgs.builder()
                        .key("SENSITIVE_VARIABLE")
                        .value("sensitive_value")
                        .target("production")
                        .sensitive(true)
                        .build())
                .build());
    
        }
    }
    
    resources:
      example:
        type: vercel:Project
        properties:
          name: example-project
          gitRepository:
            type: github
            repo: vercel/some-repo
      exampleProjectEnvironmentVariables:
        type: vercel:ProjectEnvironmentVariables
        name: example
        properties:
          projectId: ${test.id}
          variables:
            - key: SOME_VARIABLE
              value: some_value
              target:
                - production
                - preview
            - key: ANOTHER_VARIABLE
              value: another_value
              git_branch: staging
              target:
                - preview
            - key: SENSITIVE_VARIABLE
              value: sensitive_value
              target:
                - production
              sensitive: true
    

    Create ProjectEnvironmentVariables Resource

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

    Constructor syntax

    new ProjectEnvironmentVariables(name: string, args: ProjectEnvironmentVariablesArgs, opts?: CustomResourceOptions);
    @overload
    def ProjectEnvironmentVariables(resource_name: str,
                                    args: ProjectEnvironmentVariablesArgs,
                                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def ProjectEnvironmentVariables(resource_name: str,
                                    opts: Optional[ResourceOptions] = None,
                                    project_id: Optional[str] = None,
                                    variables: Optional[Sequence[ProjectEnvironmentVariablesVariableArgs]] = None,
                                    team_id: Optional[str] = None)
    func NewProjectEnvironmentVariables(ctx *Context, name string, args ProjectEnvironmentVariablesArgs, opts ...ResourceOption) (*ProjectEnvironmentVariables, error)
    public ProjectEnvironmentVariables(string name, ProjectEnvironmentVariablesArgs args, CustomResourceOptions? opts = null)
    public ProjectEnvironmentVariables(String name, ProjectEnvironmentVariablesArgs args)
    public ProjectEnvironmentVariables(String name, ProjectEnvironmentVariablesArgs args, CustomResourceOptions options)
    
    type: vercel:ProjectEnvironmentVariables
    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 ProjectEnvironmentVariablesArgs
    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 ProjectEnvironmentVariablesArgs
    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 ProjectEnvironmentVariablesArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ProjectEnvironmentVariablesArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ProjectEnvironmentVariablesArgs
    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 projectEnvironmentVariablesResource = new Vercel.ProjectEnvironmentVariables("projectEnvironmentVariablesResource", new()
    {
        ProjectId = "string",
        Variables = new[]
        {
            new Vercel.Inputs.ProjectEnvironmentVariablesVariableArgs
            {
                Key = "string",
                Value = "string",
                Comment = "string",
                CustomEnvironmentIds = new[]
                {
                    "string",
                },
                GitBranch = "string",
                Id = "string",
                Sensitive = false,
                Targets = new[]
                {
                    "string",
                },
            },
        },
        TeamId = "string",
    });
    
    example, err := vercel.NewProjectEnvironmentVariables(ctx, "projectEnvironmentVariablesResource", &vercel.ProjectEnvironmentVariablesArgs{
    	ProjectId: pulumi.String("string"),
    	Variables: vercel.ProjectEnvironmentVariablesVariableArray{
    		&vercel.ProjectEnvironmentVariablesVariableArgs{
    			Key:     pulumi.String("string"),
    			Value:   pulumi.String("string"),
    			Comment: pulumi.String("string"),
    			CustomEnvironmentIds: pulumi.StringArray{
    				pulumi.String("string"),
    			},
    			GitBranch: pulumi.String("string"),
    			Id:        pulumi.String("string"),
    			Sensitive: pulumi.Bool(false),
    			Targets: pulumi.StringArray{
    				pulumi.String("string"),
    			},
    		},
    	},
    	TeamId: pulumi.String("string"),
    })
    
    var projectEnvironmentVariablesResource = new ProjectEnvironmentVariables("projectEnvironmentVariablesResource", ProjectEnvironmentVariablesArgs.builder()
        .projectId("string")
        .variables(ProjectEnvironmentVariablesVariableArgs.builder()
            .key("string")
            .value("string")
            .comment("string")
            .customEnvironmentIds("string")
            .gitBranch("string")
            .id("string")
            .sensitive(false)
            .targets("string")
            .build())
        .teamId("string")
        .build());
    
    project_environment_variables_resource = vercel.ProjectEnvironmentVariables("projectEnvironmentVariablesResource",
        project_id="string",
        variables=[{
            "key": "string",
            "value": "string",
            "comment": "string",
            "custom_environment_ids": ["string"],
            "git_branch": "string",
            "id": "string",
            "sensitive": False,
            "targets": ["string"],
        }],
        team_id="string")
    
    const projectEnvironmentVariablesResource = new vercel.ProjectEnvironmentVariables("projectEnvironmentVariablesResource", {
        projectId: "string",
        variables: [{
            key: "string",
            value: "string",
            comment: "string",
            customEnvironmentIds: ["string"],
            gitBranch: "string",
            id: "string",
            sensitive: false,
            targets: ["string"],
        }],
        teamId: "string",
    });
    
    type: vercel:ProjectEnvironmentVariables
    properties:
        projectId: string
        teamId: string
        variables:
            - comment: string
              customEnvironmentIds:
                - string
              gitBranch: string
              id: string
              key: string
              sensitive: false
              targets:
                - string
              value: string
    

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

    ProjectId string
    The ID of the Vercel project.
    Variables List<Pulumiverse.Vercel.Inputs.ProjectEnvironmentVariablesVariable>
    A set of Environment Variables that should be configured for the project.
    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.
    ProjectId string
    The ID of the Vercel project.
    Variables []ProjectEnvironmentVariablesVariableArgs
    A set of Environment Variables that should be configured for the project.
    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.
    projectId String
    The ID of the Vercel project.
    variables List<ProjectEnvironmentVariablesVariable>
    A set of Environment Variables that should be configured for the project.
    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.
    projectId string
    The ID of the Vercel project.
    variables ProjectEnvironmentVariablesVariable[]
    A set of Environment Variables that should be configured for the project.
    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.
    project_id str
    The ID of the Vercel project.
    variables Sequence[ProjectEnvironmentVariablesVariableArgs]
    A set of Environment Variables that should be configured for the project.
    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.
    projectId String
    The ID of the Vercel project.
    variables List<Property Map>
    A set of Environment Variables that should be configured for the project.
    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.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ProjectEnvironmentVariables 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 ProjectEnvironmentVariables Resource

    Get an existing ProjectEnvironmentVariables 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?: ProjectEnvironmentVariablesState, opts?: CustomResourceOptions): ProjectEnvironmentVariables
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            project_id: Optional[str] = None,
            team_id: Optional[str] = None,
            variables: Optional[Sequence[ProjectEnvironmentVariablesVariableArgs]] = None) -> ProjectEnvironmentVariables
    func GetProjectEnvironmentVariables(ctx *Context, name string, id IDInput, state *ProjectEnvironmentVariablesState, opts ...ResourceOption) (*ProjectEnvironmentVariables, error)
    public static ProjectEnvironmentVariables Get(string name, Input<string> id, ProjectEnvironmentVariablesState? state, CustomResourceOptions? opts = null)
    public static ProjectEnvironmentVariables get(String name, Output<String> id, ProjectEnvironmentVariablesState state, CustomResourceOptions options)
    resources:  _:    type: vercel:ProjectEnvironmentVariables    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:
    ProjectId string
    The ID of the Vercel project.
    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.
    Variables List<Pulumiverse.Vercel.Inputs.ProjectEnvironmentVariablesVariable>
    A set of Environment Variables that should be configured for the project.
    ProjectId string
    The ID of the Vercel project.
    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.
    Variables []ProjectEnvironmentVariablesVariableArgs
    A set of Environment Variables that should be configured for the project.
    projectId String
    The ID of the Vercel project.
    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.
    variables List<ProjectEnvironmentVariablesVariable>
    A set of Environment Variables that should be configured for the project.
    projectId string
    The ID of the Vercel project.
    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.
    variables ProjectEnvironmentVariablesVariable[]
    A set of Environment Variables that should be configured for the project.
    project_id str
    The ID of the Vercel project.
    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.
    variables Sequence[ProjectEnvironmentVariablesVariableArgs]
    A set of Environment Variables that should be configured for the project.
    projectId String
    The ID of the Vercel project.
    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.
    variables List<Property Map>
    A set of Environment Variables that should be configured for the project.

    Supporting Types

    ProjectEnvironmentVariablesVariable, ProjectEnvironmentVariablesVariableArgs

    Key string
    The name of the Environment Variable.
    Value string
    The value of the Environment Variable.
    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.
    Id string
    The ID of the Environment Variable.
    Sensitive bool
    Whether the Environment Variable is sensitive or not.
    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.
    Key string
    The name of the Environment Variable.
    Value string
    The value of the Environment Variable.
    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.
    Id string
    The ID of the Environment Variable.
    Sensitive bool
    Whether the Environment Variable is sensitive or not.
    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.
    key String
    The name of the Environment Variable.
    value String
    The value of the Environment Variable.
    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.
    id String
    The ID of the Environment Variable.
    sensitive Boolean
    Whether the Environment Variable is sensitive or not.
    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.
    key string
    The name of the Environment Variable.
    value string
    The value of the Environment Variable.
    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.
    id string
    The ID of the Environment Variable.
    sensitive boolean
    Whether the Environment Variable is sensitive or not.
    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.
    key str
    The name of the Environment Variable.
    value str
    The value of the Environment Variable.
    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.
    id str
    The ID of the Environment Variable.
    sensitive bool
    Whether the Environment Variable is sensitive or not.
    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.
    key String
    The name of the Environment Variable.
    value String
    The value of the Environment Variable.
    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.
    id String
    The ID of the Environment Variable.
    sensitive Boolean
    Whether the Environment Variable is sensitive or not.
    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.

    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