sessions
Creates, updates, deletes, gets or lists a sessions resource.
Overview
| Name | sessions |
| Type | Resource |
| Id | aws.athena.sessions |
Fields
The following fields are returned by SELECT queries:
- get_session
- list_sessions
| Name | Datatype | Description |
|---|---|---|
description | string | The session description. |
engine_configuration | object | The engine configuration for the workgroup, which includes the minimum/maximum number of Data Processing Units (DPU) that queries should use when running in provisioned capacity. If not specified, Athena uses default values (Default value for min is 4 and for max is Minimum of 124 and allocated DPUs). To specify DPU values for PC queries the WG containing EngineConfiguration should have the following values: The name of the Classifications should be athena-query-engine-properties, with the only allowed properties as max-dpu-count and min-dpu-count. |
engine_version | string | The engine version used by the session (for example, PySpark engine version 3). You can get a list of engine versions by calling ListEngineVersions. |
monitoring_configuration | object | Contains the configuration settings for managed log persistence, delivering logs to Amazon S3 buckets, Amazon CloudWatch log groups etc. |
notebook_version | string | The notebook version. |
session_configuration | object | Contains the workgroup configuration information used by the session. |
session_id | string | The session ID. |
statistics | object | Contains the DPU execution time. |
status | object | Contains information about the status of the session. |
work_group | string | The workgroup to which the session belongs. (pattern: <code>[a-zA-Z0-9._-]{1,128}</code>) |
| Name | Datatype | Description |
|---|---|---|
next_token | string | A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call. |
sessions | array | A list of sessions. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_session | select | region | Gets the full details of a previously created session, including the session status and configuration. | |
list_sessions | select | region | Lists the sessions in a workgroup that are in an active state like CREATING, CREATED, IDLE, or BUSY. Newer sessions are listed first; older sessions are listed later. | |
create_presigned_notebook_url | insert | region, SessionId | Gets an authentication token and the URL at which the notebook can be accessed. During programmatic access, CreatePresignedNotebookUrl must be called every 10 minutes to refresh the authentication token. For information about granting programmatic access, see Grant programmatic access. | |
terminate_session | delete | region | Terminates an active session. A TerminateSession call on a session that is already inactive (for example, in a FAILED, TERMINATED or TERMINATING state) succeeds but has no effect. Calculations running in the session when TerminateSession is called are forcefully stopped, but may display as FAILED instead of STOPPED. |
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 |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- get_session
- list_sessions
Gets the full details of a previously created session, including the session status and configuration.
SELECT
description,
engine_configuration,
engine_version,
monitoring_configuration,
notebook_version,
session_configuration,
session_id,
statistics,
status,
work_group
FROM aws.athena.sessions
WHERE region = '{{ region }}' -- required
;
Lists the sessions in a workgroup that are in an active state like CREATING, CREATED, IDLE, or BUSY. Newer sessions are listed first; older sessions are listed later.
SELECT
next_token,
sessions
FROM aws.athena.sessions
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_presigned_notebook_url
- Manifest
Gets an authentication token and the URL at which the notebook can be accessed. During programmatic access, CreatePresignedNotebookUrl must be called every 10 minutes to refresh the authentication token. For information about granting programmatic access, see Grant programmatic access.
INSERT INTO aws.athena.sessions (
SessionId,
region
)
SELECT
'{{ SessionId }}' /* required */,
'{{ region }}'
RETURNING
auth_token,
auth_token_expiration_time,
notebook_url
;
# Description fields are for documentation purposes
- name: sessions
props:
- name: region
value: "{{ region }}"
description: Required parameter for the sessions resource.
- name: SessionId
value: "{{ SessionId }}"
description: |
The session ID.
DELETE examples
- terminate_session
Terminates an active session. A TerminateSession call on a session that is already inactive (for example, in a FAILED, TERMINATED or TERMINATING state) succeeds but has no effect. Calculations running in the session when TerminateSession is called are forcefully stopped, but may display as FAILED instead of STOPPED.
DELETE FROM aws.athena.sessions
WHERE region = '{{ region }}' --required
;