Skip to main content

keys

Creates, updates, deletes, gets or lists a keys resource.

Overview

Namekeys
TypeResource
Idcloudflare.zero_trust.keys

Fields

The following fields are returned by SELECT queries:

Get the Access key configuration response

NameDatatypeDescription
days_until_next_rotationnumberThe number of days until the next key rotation.
key_rotation_interval_daysnumberThe number of days between key rotations.
last_key_rotation_atstring (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:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectaccount_idGets the Access key rotation settings for an account.
updatereplaceaccount_id, key_rotation_interval_daysUpdates the Access key rotation settings for an account.
rotateexecaccount_idPerfoms 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.

NameDatatypeDescription
account_idstringThe Cloudflare account ID.

SELECT examples

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

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

Perfoms a key rotation for an account.

EXEC cloudflare.zero_trust.keys.rotate
@account_id='{{ account_id }}' --required
;