system_keys
Creates, updates, deletes, gets or lists a system_keys resource.
Overview
| Name | system_keys |
| Type | Resource |
| Id | fivetran.account.system_keys |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
id | string | The unique identifier for the system key within the Fivetran system (example: key_id) |
name | string | The system key name within the account (example: MySystemKey) |
created_at | string (date-time) | The system key creation timestamp (example: 2023-08-20T10:15:20.677566Z) |
expired_at | string (date-time) | The system key expiration timestamp (example: 2024-08-20T10:15:20.677566Z) |
key | string | The key value of the system key (example: ft_rDefAFDSgFdAGdFG) |
last_used_at | string (date-time) | The timestamp of last usage (example: 2023-08-20T10:15:20.677566Z) |
permissions | array | |
secret | string | The secret value of rotated system key (example: uytFfdSfDADFgfCgFBVsdCSFg4fsGfFg87fhRuuFASuTHkETSfg) |
updated_at | string (date-time) | The system key update timestamp (example: 2023-08-20T10:15:20.677566Z) |
| Name | Datatype | Description |
|---|---|---|
id | string | The unique identifier for the system key within the Fivetran system (example: key_id) |
name | string | The system key name within the account (example: MySystemKey) |
created_at | string (date-time) | The system key creation timestamp (example: 2023-08-20T10:15:20.677566Z) |
expired_at | string (date-time) | The system key expiration timestamp (example: 2024-08-20T10:15:20.677566Z) |
key | string | The key value of the system key (example: ft_rDefAFDSgFdAGdFG) |
last_used_at | string (date-time) | The timestamp of last usage (example: 2023-08-20T10:15:20.677566Z) |
permissions | array | |
secret | string | The secret value of rotated system key (example: uytFfdSfDADFgfCgFBVsdCSFg4fsGfFg87fhRuuFASuTHkETSfg) |
updated_at | string (date-time) | The system key update timestamp (example: 2023-08-20T10:15:20.677566Z) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | key_id | Retrieves a system key object within your Fivetran account. | |
list | select | cursor, limit | Returns a list of system keys within your Fivetran account. | |
create | insert | Creates a new system key with your Fivetran account. | ||
update | update | key_id | Updates an existing system key within your Fivetran account. | |
delete | delete | key_id | Deletes a system key from your Fivetran account. | |
rotate | exec | key_id | Updates the secret value and expired_at date for an existing system key within your Fivetran 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 |
|---|---|---|
key_id | string | The unique identifier for the system key within your Fivetran account. |
cursor | string | Paging cursor, [read more about pagination](https://fivetran.com/docs/rest-api/pagination) |
limit | integer (int32) | Number of records to fetch per page. Accepts a number in the range 1..1000; the default value is 100. |
SELECT examples
- get
- list
Retrieves a system key object within your Fivetran account.
SELECT
id,
name,
created_at,
expired_at,
key,
last_used_at,
permissions,
secret,
updated_at
FROM fivetran.account.system_keys
WHERE key_id = '{{ key_id }}' -- required
;
Returns a list of system keys within your Fivetran account.
SELECT
id,
name,
created_at,
expired_at,
key,
last_used_at,
permissions,
secret,
updated_at
FROM fivetran.account.system_keys
WHERE "limit" = '{{ limit }}'
;
INSERT examples
- create
- Manifest
Creates a new system key with your Fivetran account.
INSERT INTO fivetran.account.system_keys (
name,
expiration_period,
permissions
)
SELECT
'{{ name }}',
'{{ expiration_period }}',
'{{ permissions }}'
RETURNING
id,
name,
created_at,
expired_at,
key,
last_used_at,
permissions,
secret,
updated_at
;
# Description fields are for documentation purposes
- name: system_keys
props:
- name: name
value: "{{ name }}"
description: |
The system key name within the account
- name: expiration_period
value: "{{ expiration_period }}"
description: |
The system key's expiration period
valid_values: ['ONE_WEEK', 'ONE_MONTH', 'THREE_MONTHS', 'SIX_MONTHS', 'INFINITE']
- name: permissions
value:
- resource_type: "{{ resource_type }}"
access_level: "{{ access_level }}"
resource_filter:
ids:
- "{{ ids }}"
group_ids:
- "{{ group_ids }}"
UPDATE examples
- update
Updates an existing system key within your Fivetran account.
UPDATE fivetran.account.system_keys
SET
name = '{{ name }}',
permissions = '{{ permissions }}'
WHERE
key_id = '{{ key_id }}' --required
RETURNING
id,
name,
created_at,
expired_at,
key,
last_used_at,
permissions,
secret,
updated_at;
DELETE examples
- delete
Deletes a system key from your Fivetran account.
DELETE FROM fivetran.account.system_keys
WHERE key_id = '{{ key_id }}' --required
;
Lifecycle Methods
EXEC variables use wire (API) names.
- rotate
Updates the secret value and expired_at date for an existing system key within your Fivetran account.
EXEC fivetran.account.system_keys.rotate
@key_id='{{ key_id }}' --required
@@json=
'{
"expiration_period": "{{ expiration_period }}"
}'
;