environment_variables
Creates, updates, deletes, gets or lists an environment_variables resource.
Overview
| Name | environment_variables |
| Type | Resource |
| Id | cloudflare.workers.environment_variables |
Fields
The following fields are returned by SELECT queries:
- list
Environment variables retrieved successfully
| Name | Datatype | Description |
|---|---|---|
errors | array | |
messages | array | |
result | object | |
result_info | object | |
success | boolean |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | account_id, trigger_uuid | Get all environment variables for a trigger | |
upsert_environment_variables | update | account_id, trigger_uuid | Create or update environment variables for a trigger | |
delete_environment_variable | delete | account_id, trigger_uuid, environment_variable_key | Remove a specific environment variable from a trigger |
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 |
|---|---|---|
account_id | string | The Cloudflare account ID. |
environment_variable_key | string | |
trigger_uuid | string (uuid) |
SELECT examples
- list
Get all environment variables for a trigger
SELECT
errors,
messages,
result,
result_info,
success
FROM cloudflare.workers.environment_variables
WHERE account_id = '{{ account_id }}' -- required
AND trigger_uuid = '{{ trigger_uuid }}' -- required
;
UPDATE examples
- upsert_environment_variables
Create or update environment variables for a trigger
UPDATE cloudflare.workers.environment_variables
SET
-- No updatable properties
WHERE
account_id = '{{ account_id }}' --required
AND trigger_uuid = '{{ trigger_uuid }}' --required
RETURNING
errors,
messages,
result,
result_info,
success;
DELETE examples
- delete_environment_variable
Remove a specific environment variable from a trigger
DELETE FROM cloudflare.workers.environment_variables
WHERE account_id = '{{ account_id }}' --required
AND trigger_uuid = '{{ trigger_uuid }}' --required
AND environment_variable_key = '{{ environment_variable_key }}' --required
;