shared_env_variables
Creates, updates, deletes, gets or lists a shared_env_variables resource.
Overview
| Name | shared_env_variables |
| Type | Resource |
| Id | vercel.environments.shared_env_variables |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
id | string | The unique identifier of the Shared Env Var. (example: env_XCG7t7AIHuO2SBA8667zNUiM) |
owner_id | string | The unique identifier of the owner (team) the Shared Env Var was created for. (example: team_LLHUOMOoDlqOp8wPE4kFo9pE) (wire: ownerId) |
project_id | array | The unique identifiers of the projects which the Shared Env Var is linked to. (wire: projectId) |
last_edited_by_display_name | string | The last editor full name or username. (wire: lastEditedByDisplayName) |
apply_to_all_custom_environments | boolean | whether or not this env varible applies to custom environments (false, true) (wire: applyToAllCustomEnvironments) |
comment | string | A user provided comment that describes what this Shared Env Var is for. |
created | string (date-time) | The date when the Shared Env Var was created. (example: 2021-02-10T13:11:49.180Z) |
created_at | number | Timestamp for when the Shared Env Var was created. (wire: createdAt) |
created_by | string | The unique identifier of the user who created the Shared Env Var. (example: 2qDDuGFTWXBLDNnqZfWPDp1A) (wire: createdBy) |
custom_environment_ids | array | The custom environment IDs that this Shared Env Var is scoped to. (wire: customEnvironmentIds) |
decrypted | boolean | whether or not this env variable is decrypted (false, true) |
deleted_at | number | Timestamp for when the Shared Env Var was (soft) deleted. (wire: deletedAt) |
deleted_by | string | The unique identifier of the user who deleted the Shared Env Var. (example: 2qDDuGFTWXBLDNnqZfWPDp1A) (wire: deletedBy) |
key | string | The name of the Shared Env Var. (example: my-api-key) |
target | array | environments this env variable targets (example: production) |
type | string | The type of this cosmos doc instance, if blank, assume secret. (encrypted, plain, sensitive, system) (example: encrypted) |
updated_at | number | Timestamp for when the Shared Env Var was last updated. (wire: updatedAt) |
updated_by | string | The unique identifier of the user who last updated the Shared Env Var. (example: 2qDDuGFTWXBLDNnqZfWPDp1A) (wire: updatedBy) |
value | string | The value of the Shared Env Var. |
| Name | Datatype | Description |
|---|---|---|
id | string | The unique identifier of the Shared Env Var. (example: env_XCG7t7AIHuO2SBA8667zNUiM) |
owner_id | string | The unique identifier of the owner (team) the Shared Env Var was created for. (example: team_LLHUOMOoDlqOp8wPE4kFo9pE) (wire: ownerId) |
project_id | array | The unique identifiers of the projects which the Shared Env Var is linked to. (wire: projectId) |
last_edited_by_display_name | string | The last editor full name or username. (wire: lastEditedByDisplayName) |
apply_to_all_custom_environments | boolean | whether or not this env varible applies to custom environments (false, true) (wire: applyToAllCustomEnvironments) |
comment | string | A user provided comment that describes what this Shared Env Var is for. |
created | string (date-time) | The date when the Shared Env Var was created. (example: 2021-02-10T13:11:49.180Z) |
created_at | number | Timestamp for when the Shared Env Var was created. (wire: createdAt) |
created_by | string | The unique identifier of the user who created the Shared Env Var. (example: 2qDDuGFTWXBLDNnqZfWPDp1A) (wire: createdBy) |
custom_environment_ids | array | The custom environment IDs that this Shared Env Var is scoped to. (wire: customEnvironmentIds) |
decrypted | boolean | whether or not this env variable is decrypted (false, true) |
deleted_at | number | Timestamp for when the Shared Env Var was (soft) deleted. (wire: deletedAt) |
deleted_by | string | The unique identifier of the user who deleted the Shared Env Var. (example: 2qDDuGFTWXBLDNnqZfWPDp1A) (wire: deletedBy) |
key | string | The name of the Shared Env Var. (example: my-api-key) |
security_issues | array | (wire: securityIssues) |
target | array | environments this env variable targets (example: production) |
type | string | The type of this cosmos doc instance, if blank, assume secret. (encrypted, plain, sensitive, system) (example: encrypted) |
updated_at | number | Timestamp for when the Shared Env Var was last updated. (wire: updatedAt) |
updated_by | string | The unique identifier of the user who last updated the Shared Env Var. (example: 2qDDuGFTWXBLDNnqZfWPDp1A) (wire: updatedBy) |
value | string | The value of the Shared Env Var. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | id | team_id, slug | Retrieve the decrypted value of a Shared Environment Variable by id. |
list | select | search, project_id, ids, exclude_ids, exclude-ids, exclude_projectId, exclude-project_id, team_id, slug | Lists all Shared Environment Variables for a team, taking into account optional filters. | |
create | insert | evs, target, applyToAllCustomEnvironments, customEnvironmentIds | team_id, slug | Creates shared environment variable(s) for a team. |
update | update | updates | team_id, slug | Updates a given Shared Environment Variable for a Team. |
delete | delete | team_id, slug | Deletes one or many Shared Environment Variables for a given team. | |
unlink | exec | id, project_id | teamId, slug | Disconnects a shared environment variable for a given project |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
id | string | The unique ID for the Shared Environment Variable to unlink from the project. |
project_id | string | |
exclude-ids | string | Filter SharedEnvVariables based on comma separated ids |
exclude-project_id | string | Filter SharedEnvVariables that belong to a project (wire: exclude-projectId) |
exclude_ids | string | Filter SharedEnvVariables based on comma separated ids |
exclude_projectId | string | Filter SharedEnvVariables that belong to a project |
ids | string | Filter SharedEnvVariables based on comma separated ids |
project_id | string | Filter SharedEnvVariables that belong to a project (wire: projectId) |
search | string | |
slug | string | The Team slug to perform the request on behalf of. |
teamId | string | The Team identifier to perform the request on behalf of. |
team_id | string | The Team identifier to perform the request on behalf of. (wire: teamId) |
SELECT examples
- get
- list
Retrieve the decrypted value of a Shared Environment Variable by id.
SELECT
id,
owner_id,
project_id,
last_edited_by_display_name,
apply_to_all_custom_environments,
comment,
created,
created_at,
created_by,
custom_environment_ids,
decrypted,
deleted_at,
deleted_by,
key,
target,
type,
updated_at,
updated_by,
value
FROM vercel.environments.shared_env_variables
WHERE id = '{{ id }}' -- required
AND team_id = '{{ team_id }}'
AND slug = '{{ slug }}'
;
Lists all Shared Environment Variables for a team, taking into account optional filters.
SELECT
id,
owner_id,
project_id,
last_edited_by_display_name,
apply_to_all_custom_environments,
comment,
created,
created_at,
created_by,
custom_environment_ids,
decrypted,
deleted_at,
deleted_by,
key,
security_issues,
target,
type,
updated_at,
updated_by,
value
FROM vercel.environments.shared_env_variables
WHERE search = '{{ search }}'
AND project_id = '{{ project_id }}'
AND ids = '{{ ids }}'
AND exclude_ids = '{{ exclude_ids }}'
AND exclude-ids = '{{ exclude-ids }}'
AND exclude_projectId = '{{ exclude_projectId }}'
AND exclude-project_id = '{{ exclude-project_id }}'
AND team_id = '{{ team_id }}'
AND slug = '{{ slug }}'
;
INSERT examples
- create
- Manifest
Creates shared environment variable(s) for a team.
INSERT INTO vercel.environments.shared_env_variables (
evs,
type,
target,
project_id,
team_id,
slug
)
SELECT
'{{ evs }}' /* required */,
'{{ type }}',
'{{ target }}' /* required */,
'{{ project_id }}',
'{{ team_id }}',
'{{ slug }}'
RETURNING
created,
failed
;
# Description fields are for documentation purposes
- name: shared_env_variables
props:
- name: evs
value:
- key: "{{ key }}"
value: "{{ value }}"
comment: "{{ comment }}"
- name: type
value: "{{ type }}"
description: |
The type of environment variable
valid_values: ['encrypted', 'sensitive']
- name: target
value: "{{ target }}"
description: |
The target environment of the Shared Environment Variable
- name: project_id
value:
- "{{ project_id }}"
description: |
Associate a Shared Environment Variable to projects.
- name: team_id
value: "{{ team_id }}"
description: The Team identifier to perform the request on behalf of.
description: The Team identifier to perform the request on behalf of.
- name: slug
value: "{{ slug }}"
description: The Team slug to perform the request on behalf of.
description: The Team slug to perform the request on behalf of.
UPDATE examples
- update
Updates a given Shared Environment Variable for a Team.
UPDATE vercel.environments.shared_env_variables
SET
updates = '{{ updates }}'
WHERE
updates = '{{ updates }}' --required
AND team_id = '{{ team_id}}'
AND slug = '{{ slug}}'
RETURNING
failed,
updated;
DELETE examples
- delete
Deletes one or many Shared Environment Variables for a given team.
DELETE FROM vercel.environments.shared_env_variables
WHERE team_id = '{{ team_id }}'
AND slug = '{{ slug }}'
;
Lifecycle Methods
EXEC variables use wire (API) names.
- unlink
Disconnects a shared environment variable for a given project
EXEC vercel.environments.shared_env_variables.unlink
@id='{{ id }}' --required,
@project_id='{{ project_id }}' --required,
@teamId='{{ teamId }}',
@slug='{{ slug }}'
;