published on Thursday, Oct 15, 2026 by Pulumiverse
published on Thursday, Oct 15, 2026 by Pulumiverse
Provides a Shared Environment Variable resource.
A Shared Environment Variable resource defines an Environment Variable that can be shared between multiple Vercel Projects.
For more detailed information, please see the Vercel documentation.
Note: Starting in provider version
4.8.0, environment variables require an explicitsensitivevalue. Variables targetingdevelopmentmust setsensitive = false. Team sensitive-environment-variable policy is enforced by the Vercel API at apply time.
Note: Write-Only argument
value_wois available to use in place ofvalue. Write-Only arguments are supported in HashiCorp Terraform 1.11.0 and later. Learn more.
Create SharedEnvironmentVariable Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new SharedEnvironmentVariable(name: string, args: SharedEnvironmentVariableArgs, opts?: CustomResourceOptions);@overload
def SharedEnvironmentVariable(resource_name: str,
args: SharedEnvironmentVariableArgs,
opts: Optional[ResourceOptions] = None)
@overload
def SharedEnvironmentVariable(resource_name: str,
opts: Optional[ResourceOptions] = None,
key: Optional[str] = None,
sensitive: Optional[bool] = None,
apply_to_all_custom_environments: Optional[bool] = None,
comment: Optional[str] = None,
project_ids: Optional[Sequence[str]] = None,
targets: Optional[Sequence[str]] = None,
team_id: Optional[str] = None,
value: Optional[str] = None,
value_wo: Optional[str] = None,
value_wo_version: Optional[int] = None)func NewSharedEnvironmentVariable(ctx *Context, name string, args SharedEnvironmentVariableArgs, opts ...ResourceOption) (*SharedEnvironmentVariable, error)public SharedEnvironmentVariable(string name, SharedEnvironmentVariableArgs args, CustomResourceOptions? opts = null)
public SharedEnvironmentVariable(String name, SharedEnvironmentVariableArgs args)
public SharedEnvironmentVariable(String name, SharedEnvironmentVariableArgs args, CustomResourceOptions options)
type: vercel:SharedEnvironmentVariable
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "vercel_shared_environment_variable" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args SharedEnvironmentVariableArgs
- 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 SharedEnvironmentVariableArgs
- 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 SharedEnvironmentVariableArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args SharedEnvironmentVariableArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args SharedEnvironmentVariableArgs
- 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 sharedEnvironmentVariableResource = new Vercel.SharedEnvironmentVariable("sharedEnvironmentVariableResource", new()
{
Key = "string",
Sensitive = false,
ApplyToAllCustomEnvironments = false,
Comment = "string",
ProjectIds = new[]
{
"string",
},
Targets = new[]
{
"string",
},
TeamId = "string",
Value = "string",
ValueWo = "string",
ValueWoVersion = 0,
});
example, err := vercel.NewSharedEnvironmentVariable(ctx, "sharedEnvironmentVariableResource", &vercel.SharedEnvironmentVariableArgs{
Key: pulumi.String("string"),
Sensitive: pulumi.Bool(false),
ApplyToAllCustomEnvironments: pulumi.Bool(false),
Comment: pulumi.String("string"),
ProjectIds: pulumi.StringArray{
pulumi.String("string"),
},
Targets: pulumi.StringArray{
pulumi.String("string"),
},
TeamId: pulumi.String("string"),
Value: pulumi.String("string"),
ValueWo: pulumi.String("string"),
ValueWoVersion: pulumi.Int(0),
})
resource "vercel_shared_environment_variable" "sharedEnvironmentVariableResource" {
lifecycle {
create_before_destroy = true
}
key = "string"
sensitive = false
apply_to_all_custom_environments = false
comment = "string"
project_ids = ["string"]
targets = ["string"]
team_id = "string"
value = "string"
value_wo = "string"
value_wo_version = 0
}
var sharedEnvironmentVariableResource = new SharedEnvironmentVariable("sharedEnvironmentVariableResource", SharedEnvironmentVariableArgs.builder()
.key("string")
.sensitive(false)
.applyToAllCustomEnvironments(false)
.comment("string")
.projectIds("string")
.targets("string")
.teamId("string")
.value("string")
.valueWo("string")
.valueWoVersion(0)
.build());
shared_environment_variable_resource = vercel.SharedEnvironmentVariable("sharedEnvironmentVariableResource",
key="string",
sensitive=False,
apply_to_all_custom_environments=False,
comment="string",
project_ids=["string"],
targets=["string"],
team_id="string",
value="string",
value_wo="string",
value_wo_version=0)
const sharedEnvironmentVariableResource = new vercel.SharedEnvironmentVariable("sharedEnvironmentVariableResource", {
key: "string",
sensitive: false,
applyToAllCustomEnvironments: false,
comment: "string",
projectIds: ["string"],
targets: ["string"],
teamId: "string",
value: "string",
valueWo: "string",
valueWoVersion: 0,
});
type: vercel:SharedEnvironmentVariable
properties:
applyToAllCustomEnvironments: false
comment: string
key: string
projectIds:
- string
sensitive: false
targets:
- string
teamId: string
value: string
valueWo: string
valueWoVersion: 0
SharedEnvironmentVariable 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 SharedEnvironmentVariable resource accepts the following input properties:
- Key string
- The name of the Environment Variable.
- Sensitive bool
- Whether the Environment Variable is sensitive (meaning it cannot be read via the API or Vercel Dashboard once set). This must be explicitly set. Variables targeting
developmentmust set this tofalse. - Apply
To boolAll Custom Environments - Whether the shared environment variable should be applied to all custom environments in the linked projects.
- Comment string
- A comment explaining what the environment variable is for.
- Project
Ids List<string> - The ID of the Vercel project.
- Targets List<string>
- The environments that the Environment Variable should be present on. Valid targets are either
production,preview, ordevelopment. - Team
Id string - The ID of the Vercel team. Shared environment variables require a team.
- Value string
- (Optional, exactly one of
valueorvalue_wois required) The value of the Environment Variable. - Value
Wo 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
valueorvalue_wois required) The value of the Environment Variable, from anephemeralresource. - Value
Wo intVersion - An integer used to trigger an update to
value_wo. Increment this value when an update to the write-only value is required.
- Key string
- The name of the Environment Variable.
- Sensitive bool
- Whether the Environment Variable is sensitive (meaning it cannot be read via the API or Vercel Dashboard once set). This must be explicitly set. Variables targeting
developmentmust set this tofalse. - Apply
To boolAll Custom Environments - Whether the shared environment variable should be applied to all custom environments in the linked projects.
- Comment string
- A comment explaining what the environment variable is for.
- Project
Ids []string - The ID of the Vercel project.
- Targets []string
- The environments that the Environment Variable should be present on. Valid targets are either
production,preview, ordevelopment. - Team
Id string - The ID of the Vercel team. Shared environment variables require a team.
- Value string
- (Optional, exactly one of
valueorvalue_wois required) The value of the Environment Variable. - Value
Wo 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
valueorvalue_wois required) The value of the Environment Variable, from anephemeralresource. - Value
Wo intVersion - An integer used to trigger an update to
value_wo. Increment this value when an update to the write-only value is required.
- key string
- The name of the Environment Variable.
- sensitive bool
- Whether the Environment Variable is sensitive (meaning it cannot be read via the API or Vercel Dashboard once set). This must be explicitly set. Variables targeting
developmentmust set this tofalse. - apply_
to_ boolall_ custom_ environments - Whether the shared environment variable should be applied to all custom environments in the linked projects.
- comment string
- A comment explaining what the environment variable is for.
- project_
ids list(string) - The ID of the Vercel project.
- targets list(string)
- The environments that the Environment Variable should be present on. Valid targets are either
production,preview, ordevelopment. - team_
id string - The ID of the Vercel team. Shared environment variables require a team.
- value string
- (Optional, exactly one of
valueorvalue_wois required) The value of the Environment Variable. - value_
wo 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
valueorvalue_wois required) The value of the Environment Variable, from anephemeralresource. - value_
wo_ numberversion - An integer used to trigger an update to
value_wo. Increment this value when an update to the write-only value is required.
- key String
- The name of the Environment Variable.
- sensitive Boolean
- Whether the Environment Variable is sensitive (meaning it cannot be read via the API or Vercel Dashboard once set). This must be explicitly set. Variables targeting
developmentmust set this tofalse. - apply
To BooleanAll Custom Environments - Whether the shared environment variable should be applied to all custom environments in the linked projects.
- comment String
- A comment explaining what the environment variable is for.
- project
Ids List<String> - The ID of the Vercel project.
- targets List<String>
- The environments that the Environment Variable should be present on. Valid targets are either
production,preview, ordevelopment. - team
Id String - The ID of the Vercel team. Shared environment variables require a team.
- value String
- (Optional, exactly one of
valueorvalue_wois required) The value of the Environment Variable. - value
Wo 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
valueorvalue_wois required) The value of the Environment Variable, from anephemeralresource. - value
Wo IntegerVersion - An integer used to trigger an update to
value_wo. Increment this value when an update to the write-only value is required.
- key string
- The name of the Environment Variable.
- sensitive boolean
- Whether the Environment Variable is sensitive (meaning it cannot be read via the API or Vercel Dashboard once set). This must be explicitly set. Variables targeting
developmentmust set this tofalse. - apply
To booleanAll Custom Environments - Whether the shared environment variable should be applied to all custom environments in the linked projects.
- comment string
- A comment explaining what the environment variable is for.
- project
Ids string[] - The ID of the Vercel project.
- targets string[]
- The environments that the Environment Variable should be present on. Valid targets are either
production,preview, ordevelopment. - team
Id string - The ID of the Vercel team. Shared environment variables require a team.
- value string
- (Optional, exactly one of
valueorvalue_wois required) The value of the Environment Variable. - value
Wo 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
valueorvalue_wois required) The value of the Environment Variable, from anephemeralresource. - value
Wo numberVersion - An integer used to trigger an update to
value_wo. Increment this value when an update to the write-only value is required.
- key str
- The name of the Environment Variable.
- sensitive bool
- Whether the Environment Variable is sensitive (meaning it cannot be read via the API or Vercel Dashboard once set). This must be explicitly set. Variables targeting
developmentmust set this tofalse. - apply_
to_ boolall_ custom_ environments - Whether the shared environment variable should be applied to all custom environments in the linked projects.
- comment str
- A comment explaining what the environment variable is for.
- project_
ids Sequence[str] - The ID of the Vercel project.
- targets Sequence[str]
- The environments that the Environment Variable should be present on. Valid targets are either
production,preview, ordevelopment. - team_
id str - The ID of the Vercel team. Shared environment variables require a team.
- value str
- (Optional, exactly one of
valueorvalue_wois 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
valueorvalue_wois required) The value of the Environment Variable, from anephemeralresource. - value_
wo_ intversion - An integer used to trigger an update to
value_wo. Increment this value when an update to the write-only value is required.
- key String
- The name of the Environment Variable.
- sensitive Boolean
- Whether the Environment Variable is sensitive (meaning it cannot be read via the API or Vercel Dashboard once set). This must be explicitly set. Variables targeting
developmentmust set this tofalse. - apply
To BooleanAll Custom Environments - Whether the shared environment variable should be applied to all custom environments in the linked projects.
- comment String
- A comment explaining what the environment variable is for.
- project
Ids List<String> - The ID of the Vercel project.
- targets List<String>
- The environments that the Environment Variable should be present on. Valid targets are either
production,preview, ordevelopment. - team
Id String - The ID of the Vercel team. Shared environment variables require a team.
- value String
- (Optional, exactly one of
valueorvalue_wois required) The value of the Environment Variable. - value
Wo 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
valueorvalue_wois required) The value of the Environment Variable, from anephemeralresource. - value
Wo NumberVersion - An integer used to trigger an update to
value_wo. Increment this value when an update to the write-only value is required.
Outputs
All input properties are implicitly available as output properties. Additionally, the SharedEnvironmentVariable 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 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 SharedEnvironmentVariable Resource
Get an existing SharedEnvironmentVariable 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?: SharedEnvironmentVariableState, opts?: CustomResourceOptions): SharedEnvironmentVariable@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
apply_to_all_custom_environments: Optional[bool] = None,
comment: Optional[str] = None,
key: Optional[str] = None,
project_ids: Optional[Sequence[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,
value_wo_version: Optional[int] = None) -> SharedEnvironmentVariablefunc GetSharedEnvironmentVariable(ctx *Context, name string, id IDInput, state *SharedEnvironmentVariableState, opts ...ResourceOption) (*SharedEnvironmentVariable, error)public static SharedEnvironmentVariable Get(string name, Input<string> id, SharedEnvironmentVariableState? state, CustomResourceOptions? opts = null)public static SharedEnvironmentVariable get(String name, Output<String> id, SharedEnvironmentVariableState state, CustomResourceOptions options)resources: _: type: vercel:SharedEnvironmentVariable get: id: ${id}import {
to = vercel_shared_environment_variable.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.
- Apply
To boolAll Custom Environments - Whether the shared environment variable should be applied to all custom environments in the linked projects.
- Comment string
- A comment explaining what the environment variable is for.
- Key string
- The name of the Environment Variable.
- Project
Ids List<string> - The ID of the Vercel project.
- Sensitive bool
- Whether the Environment Variable is sensitive (meaning it cannot be read via the API or Vercel Dashboard once set). This must be explicitly set. Variables targeting
developmentmust set this tofalse. - Targets List<string>
- The environments that the Environment Variable should be present on. Valid targets are either
production,preview, ordevelopment. - Team
Id string - The ID of the Vercel team. Shared environment variables require a team.
- Value string
- (Optional, exactly one of
valueorvalue_wois required) The value of the Environment Variable. - Value
Wo 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
valueorvalue_wois required) The value of the Environment Variable, from anephemeralresource. - Value
Wo intVersion - An integer used to trigger an update to
value_wo. Increment this value when an update to the write-only value is required.
- Apply
To boolAll Custom Environments - Whether the shared environment variable should be applied to all custom environments in the linked projects.
- Comment string
- A comment explaining what the environment variable is for.
- Key string
- The name of the Environment Variable.
- Project
Ids []string - The ID of the Vercel project.
- Sensitive bool
- Whether the Environment Variable is sensitive (meaning it cannot be read via the API or Vercel Dashboard once set). This must be explicitly set. Variables targeting
developmentmust set this tofalse. - Targets []string
- The environments that the Environment Variable should be present on. Valid targets are either
production,preview, ordevelopment. - Team
Id string - The ID of the Vercel team. Shared environment variables require a team.
- Value string
- (Optional, exactly one of
valueorvalue_wois required) The value of the Environment Variable. - Value
Wo 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
valueorvalue_wois required) The value of the Environment Variable, from anephemeralresource. - Value
Wo intVersion - An integer used to trigger an update to
value_wo. Increment this value when an update to the write-only value is required.
- apply_
to_ boolall_ custom_ environments - Whether the shared environment variable should be applied to all custom environments in the linked projects.
- comment string
- A comment explaining what the environment variable is for.
- key string
- The name of the Environment Variable.
- project_
ids list(string) - The ID of the Vercel project.
- sensitive bool
- Whether the Environment Variable is sensitive (meaning it cannot be read via the API or Vercel Dashboard once set). This must be explicitly set. Variables targeting
developmentmust set this tofalse. - targets list(string)
- The environments that the Environment Variable should be present on. Valid targets are either
production,preview, ordevelopment. - team_
id string - The ID of the Vercel team. Shared environment variables require a team.
- value string
- (Optional, exactly one of
valueorvalue_wois required) The value of the Environment Variable. - value_
wo 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
valueorvalue_wois required) The value of the Environment Variable, from anephemeralresource. - value_
wo_ numberversion - An integer used to trigger an update to
value_wo. Increment this value when an update to the write-only value is required.
- apply
To BooleanAll Custom Environments - Whether the shared environment variable should be applied to all custom environments in the linked projects.
- comment String
- A comment explaining what the environment variable is for.
- key String
- The name of the Environment Variable.
- project
Ids List<String> - The ID of the Vercel project.
- sensitive Boolean
- Whether the Environment Variable is sensitive (meaning it cannot be read via the API or Vercel Dashboard once set). This must be explicitly set. Variables targeting
developmentmust set this tofalse. - targets List<String>
- The environments that the Environment Variable should be present on. Valid targets are either
production,preview, ordevelopment. - team
Id String - The ID of the Vercel team. Shared environment variables require a team.
- value String
- (Optional, exactly one of
valueorvalue_wois required) The value of the Environment Variable. - value
Wo 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
valueorvalue_wois required) The value of the Environment Variable, from anephemeralresource. - value
Wo IntegerVersion - An integer used to trigger an update to
value_wo. Increment this value when an update to the write-only value is required.
- apply
To booleanAll Custom Environments - Whether the shared environment variable should be applied to all custom environments in the linked projects.
- comment string
- A comment explaining what the environment variable is for.
- key string
- The name of the Environment Variable.
- project
Ids string[] - The ID of the Vercel project.
- sensitive boolean
- Whether the Environment Variable is sensitive (meaning it cannot be read via the API or Vercel Dashboard once set). This must be explicitly set. Variables targeting
developmentmust set this tofalse. - targets string[]
- The environments that the Environment Variable should be present on. Valid targets are either
production,preview, ordevelopment. - team
Id string - The ID of the Vercel team. Shared environment variables require a team.
- value string
- (Optional, exactly one of
valueorvalue_wois required) The value of the Environment Variable. - value
Wo 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
valueorvalue_wois required) The value of the Environment Variable, from anephemeralresource. - value
Wo numberVersion - An integer used to trigger an update to
value_wo. Increment this value when an update to the write-only value is required.
- apply_
to_ boolall_ custom_ environments - Whether the shared environment variable should be applied to all custom environments in the linked projects.
- comment str
- A comment explaining what the environment variable is for.
- key str
- The name of the Environment Variable.
- project_
ids Sequence[str] - The ID of the Vercel project.
- sensitive bool
- Whether the Environment Variable is sensitive (meaning it cannot be read via the API or Vercel Dashboard once set). This must be explicitly set. Variables targeting
developmentmust set this tofalse. - targets Sequence[str]
- The environments that the Environment Variable should be present on. Valid targets are either
production,preview, ordevelopment. - team_
id str - The ID of the Vercel team. Shared environment variables require a team.
- value str
- (Optional, exactly one of
valueorvalue_wois 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
valueorvalue_wois required) The value of the Environment Variable, from anephemeralresource. - value_
wo_ intversion - An integer used to trigger an update to
value_wo. Increment this value when an update to the write-only value is required.
- apply
To BooleanAll Custom Environments - Whether the shared environment variable should be applied to all custom environments in the linked projects.
- comment String
- A comment explaining what the environment variable is for.
- key String
- The name of the Environment Variable.
- project
Ids List<String> - The ID of the Vercel project.
- sensitive Boolean
- Whether the Environment Variable is sensitive (meaning it cannot be read via the API or Vercel Dashboard once set). This must be explicitly set. Variables targeting
developmentmust set this tofalse. - targets List<String>
- The environments that the Environment Variable should be present on. Valid targets are either
production,preview, ordevelopment. - team
Id String - The ID of the Vercel team. Shared environment variables require a team.
- value String
- (Optional, exactly one of
valueorvalue_wois required) The value of the Environment Variable. - value
Wo 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
valueorvalue_wois required) The value of the Environment Variable, from anephemeralresource. - value
Wo NumberVersion - An integer used to trigger an update to
value_wo. Increment this value when an update to the write-only value is required.
Import
The pulumi import command can be used, for example:
You can import via the team_id and environment variable id.
- team_id can be found in the team
settingstab in the Vercel UI. - environment variable id can be taken from the network tab inside developer tools, while you are on the project page.
Note also, that the value field for sensitive environment variables will be imported as null.
$ pulumi import vercel:index/sharedEnvironmentVariable:SharedEnvironmentVariable example team_xxxxxxxxxxxxxxxxxxxxxxxx/env_yyyyyyyyyyyyy
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 Thursday, Oct 15, 2026 by Pulumiverse