service_account_keys
Creates, updates, deletes, gets or lists a service_account_keys resource.
Overview
| Name | service_account_keys | 
| Type | Resource | 
| Id | datadog.organization.service_account_keys | 
Fields
The following fields are returned by SELECT queries:
- get_service_account_application_key
- list_service_account_application_keys
| Name | Datatype | Description | 
|---|---|---|
| id | string | ID of the application key. | 
| attributes | object | Attributes of a partial application key. | 
| relationships | object | Resources related to the application key. | 
| type | string | Application Keys resource type. (default: application_keys, example: application_keys) | 
| Name | Datatype | Description | 
|---|---|---|
| id | string | ID of the application key. | 
| attributes | object | Attributes of a partial application key. | 
| relationships | object | Resources related to the application key. | 
| type | string | Application Keys resource type. (default: application_keys, example: application_keys) | 
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description | 
|---|---|---|---|---|
| get_service_account_application_key | select | service_account_id,app_key_id,region | Get an application key owned by this service account. | |
| list_service_account_application_keys | select | service_account_id,region | page[size],page[number],sort,filter,filter[created_at][start],filter[created_at][end] | List all application keys available for this service account. | 
| create_service_account_application_key | insert | service_account_id,region,data__data | Create an application key for this service account. | |
| update_service_account_application_key | update | service_account_id,app_key_id,region,data__data | Edit an application key owned by this service account. | |
| delete_service_account_application_key | delete | service_account_id,app_key_id,region | Delete an application key owned by this service 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 | 
|---|---|---|
| app_key_id | string | The ID of the application key. | 
| region | string | (default: datadoghq.com) | 
| service_account_id | string | The ID of the service account. | 
| filter | string | Filter application keys by the specified string. | 
| filter[created_at][end] | string | Only include application keys created on or before the specified date. | 
| filter[created_at][start] | string | Only include application keys created on or after the specified date. | 
| page[number] | integer (int64) | Specific page number to return. | 
| page[size] | integer (int64) | Size for a given page. The maximum allowed value is 100. | 
| sort | string | Application key attribute used to sort results. Sort order is ascending by default. In order to specify a descending sort, prefix the attribute with a minus sign. | 
SELECT examples
- get_service_account_application_key
- list_service_account_application_keys
Get an application key owned by this service account.
SELECT
id,
attributes,
relationships,
type
FROM datadog.organization.service_account_keys
WHERE service_account_id = '{{ service_account_id }}' -- required
AND app_key_id = '{{ app_key_id }}' -- required
AND region = '{{ region }}' -- required
;
List all application keys available for this service account.
SELECT
id,
attributes,
relationships,
type
FROM datadog.organization.service_account_keys
WHERE service_account_id = '{{ service_account_id }}' -- required
AND region = '{{ region }}' -- required
AND page[size] = '{{ page[size] }}'
AND page[number] = '{{ page[number] }}'
AND sort = '{{ sort }}'
AND filter = '{{ filter }}'
AND filter[created_at][start] = '{{ filter[created_at][start] }}'
AND filter[created_at][end] = '{{ filter[created_at][end] }}'
;
INSERT examples
- create_service_account_application_key
- Manifest
Create an application key for this service account.
INSERT INTO datadog.organization.service_account_keys (
data__data,
service_account_id,
region
)
SELECT 
'{{ data }}' /* required */,
'{{ service_account_id }}',
'{{ region }}'
RETURNING
data,
included
;
# Description fields are for documentation purposes
- name: service_account_keys
  props:
    - name: service_account_id
      value: string
      description: Required parameter for the service_account_keys resource.
    - name: region
      value: string
      description: Required parameter for the service_account_keys resource.
    - name: data
      value: object
      description: |
        Object used to create an application key.
UPDATE examples
- update_service_account_application_key
Edit an application key owned by this service account.
UPDATE datadog.organization.service_account_keys
SET 
data__data = '{{ data }}'
WHERE 
service_account_id = '{{ service_account_id }}' --required
AND app_key_id = '{{ app_key_id }}' --required
AND region = '{{ region }}' --required
AND data__data = '{{ data }}' --required
RETURNING
data,
included;
DELETE examples
- delete_service_account_application_key
Delete an application key owned by this service account.
DELETE FROM datadog.organization.service_account_keys
WHERE service_account_id = '{{ service_account_id }}' --required
AND app_key_id = '{{ app_key_id }}' --required
AND region = '{{ region }}' --required
;