Skip to main content

access_keys

Creates, updates, deletes, gets or lists an access_keys resource.

Overview

Nameaccess_keys
TypeResource
Idsumologic.service_accounts.access_keys

Fields

The following fields are returned by SELECT queries:

Access key object that was requested of a service account.

NameDatatypeDescription
idstringIdentifier of the access key. (example: su0w3Q37CBzHUM)
service_account_idstringIdentifier of the service account who owns the access key. (example: 0000000006743FDA) (wire: serviceAccountId)
cors_headersarrayAn array of domains for which the access key is valid. Whether Sumo Logic accepts or rejects an API request depends on whether it contains an ORIGIN header and the entries in the allowlist. Sumo Logic will reject: 1. Requests with an ORIGIN header but the allowlist is empty. 2. Requests with an ORIGIN header that don't match any entry in the allowlist. (wire: corsHeaders)
created_atstring (date-time)Creation timestamp in UTC in [RFC3339](https:​//tools.ietf.org/html/rfc3339) format. (example: 2018-10-16T09:10:00.000Z) (wire: createdAt)
created_bystringIdentifier of the user who created the access key. (example: 0000000006743FDD) (wire: createdBy)
disabledbooleanIndicates whether the access key is disabled or not.
effective_scopesarrayEffective scopes based on the intersection of the user's RBAC capabilities and the assigned scopes. (wire: effectiveScopes)
labelstringThe name of the access key. (example: collector access key)
last_usedstring (date-time)Last used timestamp in UTC. <br /> Note: Property not in use, it is part of an upcoming feature. (example: 2018-10-16T09:10:00.000Z) (wire: lastUsed)
modified_atstring (date-time)Last modification timestamp in UTC. (example: 2018-10-16T09:10:00.000Z) (wire: modifiedAt)
modified_bystringIdentifier of the user who modified the access key. (example: 0000000006743FDD) (wire: modifiedBy)
scopesarrayScopes assigned to the key. ### Alerting - adminMonitorsV2 - viewMonitorsV2 - manageMonitorsV2 ### Data Management - manageApps - viewCollectors - manageCollectors - viewConnections - manageConnections - contentAdmin - viewFieldExtractionRules - manageFieldExtractionRules - viewFields - manageFields - manageBudgets - viewLibrary - manageLibrary - viewPartitions - managePartitions - manageS3DataForwarding - viewScheduledViews - manageScheduledViews - manageTokens ### Logs - runLogSearch ### Metrics - runMetricsQuery ### Reliability Management - viewSlos - manageSlos ### Security - manageAccessKeys - viewPersonalAccessKeys - managePersonalAccessKeys ### UserManagement - viewUsersAndRoles - manageUsersAndRoles

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectservice_account_id, access_id, regionGet an access key with the given identifier from the organization of a service account.
listselectservice_account_id, regionList all access keys of a service account.
createinsertservice_account_id, region, labelCreates a new access ID and key pair for a service account.
updateupdateservice_account_id, access_id, region, disabledUpdates the properties of existing accessKey by Id of a service account.
deletedeleteservice_account_id, access_id, regionDeletes the access key with the given Id of a 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.

NameDatatypeDescription
access_idstringThe Id of the access key to delete of a service account. (wire: accessId)
regionstringSumo Logic deployment (au, ca, ch, de, eu, fed, in, jp, kr, us1, us2). Resolved from the SUMOLOGIC_ENVIRONMENT environment variable when it is set (x-stackQL-envVar, the same variable the Terraform provider reads); otherwise defaults to us2. A WHERE region = '...' value always takes precedence. (enum: [au, ca, ch, de, eu, fed, in, jp, kr, us1, us2], default: us2, x-stackQL-envVar: SUMOLOGIC_ENVIRONMENT)
service_account_idstringIdentifier of the service account. (wire: serviceAccountId)

SELECT examples

Get an access key with the given identifier from the organization of a service account.

SELECT
id,
service_account_id,
cors_headers,
created_at,
created_by,
disabled,
effective_scopes,
label,
last_used,
modified_at,
modified_by,
scopes
FROM sumologic.service_accounts.access_keys
WHERE service_account_id = '{{ service_account_id }}' -- required
AND access_id = '{{ access_id }}' -- required
AND region = '{{ region }}' -- required unless SUMOLOGIC_ENVIRONMENT is set
;

INSERT examples

Creates a new access ID and key pair for a service account.

INSERT INTO sumologic.service_accounts.access_keys (
label,
cors_headers,
scopes,
service_account_id,
region
)
SELECT
'{{ label }}' /* required */,
'{{ cors_headers }}',
'{{ scopes }}',
'{{ service_account_id }}',
'{{ region }}'
RETURNING
id,
service_account_id,
cors_headers,
created_at,
created_by,
disabled,
effective_scopes,
key,
label,
last_used,
modified_at,
modified_by,
scopes
;

UPDATE examples

Updates the properties of existing accessKey by Id of a service account.

UPDATE sumologic.service_accounts.access_keys
SET
disabled = {{ disabled }},
cors_headers = '{{ cors_headers }}',
scopes = '{{ scopes }}'
WHERE
service_account_id = '{{ service_account_id }}' --required
AND access_id = '{{ access_id }}' --required
AND region = '{{ region }}' --required unless SUMOLOGIC_ENVIRONMENT is set
AND disabled = {{ disabled }} --required
RETURNING
id,
service_account_id,
cors_headers,
created_at,
created_by,
disabled,
effective_scopes,
label,
last_used,
modified_at,
modified_by,
scopes;

DELETE examples

Deletes the access key with the given Id of a service account.

DELETE FROM sumologic.service_accounts.access_keys
WHERE service_account_id = '{{ service_account_id }}' --required
AND access_id = '{{ access_id }}' --required
AND region = '{{ region }}' --required unless SUMOLOGIC_ENVIRONMENT is set
;