keys
Creates, updates, deletes, gets or lists a keys resource.
Overview
| Name | keys |
| Type | Resource |
| Id | cloudflare.zero_trust.keys |
Fields
The following fields are returned by SELECT queries:
- list
Get the Access key configuration response
| Name | Datatype | Description |
|---|---|---|
days_until_next_rotation | number | The number of days until the next key rotation. |
key_rotation_interval_days | number | The number of days between key rotations. |
last_key_rotation_at | string (date-time) | The timestamp of the previous key rotation. (example: 2014-01-01T05:20:00.12345Z) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | account_id | Gets the Access key rotation settings for an account. | |
update | replace | account_id, key_rotation_interval_days | Updates the Access key rotation settings for an account. | |
rotate | exec | account_id | Perfoms a key rotation for an account. |
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. |
SELECT examples
- list
Gets the Access key rotation settings for an account.
SELECT
days_until_next_rotation,
key_rotation_interval_days,
last_key_rotation_at
FROM cloudflare.zero_trust.keys
WHERE account_id = '{{ account_id }}' -- required
;
REPLACE examples
- update
Updates the Access key rotation settings for an account.
REPLACE cloudflare.zero_trust.keys
SET
key_rotation_interval_days = {{ key_rotation_interval_days }}
WHERE
account_id = '{{ account_id }}' --required
AND key_rotation_interval_days = '{{ key_rotation_interval_days }}' --required
RETURNING
errors,
messages,
result,
success;
Lifecycle Methods
- rotate
Perfoms a key rotation for an account.
EXEC cloudflare.zero_trust.keys.rotate
@account_id='{{ account_id }}' --required
;