sessions
Creates, updates, deletes, gets or lists a sessions resource.
Overview
| Name | sessions |
| Type | Resource |
| Id | aws.emr_serverless.sessions |
Fields
The following fields are returned by SELECT queries:
- get_session
- list_sessions
| Name | Datatype | Description |
|---|---|---|
name | string | The optional name of the session. (pattern: <code>.\S.</code>) |
application_id | string | The ID of the application that the session belongs to. (pattern: <code>[0-9a-z]+</code>) |
arn | string | The Amazon Resource Name (ARN) of the session. (pattern: <code>arn:(aws[a-zA-Z0-9-]*):emr-serverless:.+:(\d{12}):/applications/[0-9a-zA-Z]+/sessions/[0-9a-zA-Z]+</code>) |
billed_resource_utilization | object | The aggregate vCPU, memory, and storage that Amazon Web Services has billed for the session. The billed resources include a 1-minute minimum usage for workers, plus additional storage over 20 GB per worker. Note that billed resources do not include usage for idle pre-initialized workers. |
configuration_overrides | object | The configuration overrides for the session, including runtime configuration properties. |
created_at | string (date-time) | The date and time that the session was created. |
created_by | string | The IAM principal that created the session. (pattern: <code>arn:(aws[a-zA-Z0-9-]*):(iam|sts)::(\d{12})?:[\w/+=,.@-]+</code>) |
ended_at | string (date-time) | The date and time that the session was terminated or failed. |
execution_role_arn | string | The Amazon Resource Name (ARN) of the execution role for the session. (pattern: <code>arn:(aws[a-zA-Z0-9-]*):iam::([0-9]{12}):(role((\u002F)|(\u002F[\u0021-\u007F]+\u002F))[\w+=,.@-]+)</code>) |
idle_since | string (date-time) | The date and time that the session became idle. |
idle_timeout_minutes | integer (int64) | The idle timeout in minutes for the session. After the session remains idle for this duration, it is automatically terminated. |
network_configuration | object | The network configuration for customer VPC connectivity. |
release_label | string | The Amazon EMR release label associated with the session. (pattern: <code>[A-Za-z0-9._/-]+</code>) |
session_id | string | The ID of the session. (pattern: <code>[0-9a-z]+</code>) |
started_at | string (date-time) | The date and time that the session moved to a running state. |
state | string | The state of the session. (SUBMITTED, STARTING, STARTED, IDLE, BUSY, FAILED, TERMINATING, TERMINATED) |
state_details | string | Additional details about the current state of the session. (pattern: <code>.\S.</code>) |
tags | object | The tags assigned to the session. |
total_execution_duration_seconds | integer (int64) | The total execution duration of the session in seconds. |
total_resource_utilization | object | The aggregate vCPU, memory, and storage resources used from the time the session starts to execute, until the time the session terminates, rounded up to the nearest second. |
updated_at | string (date-time) | The date and time that the session was last updated. |
| Name | Datatype | Description |
|---|---|---|
name | string | The optional name of the session. (pattern: <code>.\S.</code>) |
application_id | string | The ID of the application that the session belongs to. (pattern: <code>[0-9a-z]+</code>) |
arn | string | The Amazon Resource Name (ARN) of the session. (pattern: <code>arn:(aws[a-zA-Z0-9-]*):emr-serverless:.+:(\d{12}):/applications/[0-9a-zA-Z]+/sessions/[0-9a-zA-Z]+</code>) |
created_at | string (date-time) | The date and time that the session was created. |
created_by | string | The IAM principal that created the session. (pattern: <code>arn:(aws[a-zA-Z0-9-]*):(iam|sts)::(\d{12})?:[\w/+=,.@-]+</code>) |
execution_role_arn | string | The Amazon Resource Name (ARN) of the execution role for the session. (pattern: <code>arn:(aws[a-zA-Z0-9-]*):iam::([0-9]{12}):(role((\u002F)|(\u002F[\u0021-\u007F]+\u002F))[\w+=,.@-]+)</code>) |
release_label | string | The Amazon EMR release label associated with the session. (pattern: <code>[A-Za-z0-9._/-]+</code>) |
session_id | string | The ID of the session. (pattern: <code>[0-9a-z]+</code>) |
state | string | The state of the session. (SUBMITTED, STARTING, STARTED, IDLE, BUSY, FAILED, TERMINATING, TERMINATED) |
state_details | string | Additional details about the current state of the session. (pattern: <code>.\S.</code>) |
updated_at | string (date-time) | The date and time that the session was last updated. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_session | select | application_id, session_id, region | Displays detailed information about a session. | |
list_sessions | select | application_id, region | nextToken, maxResults, states, createdAtAfter, createdAtBefore | Lists sessions for the specified application. You can filter sessions by state and creation time. |
terminate_session | delete | application_id, session_id, region | Terminates the specified session. After you terminate a session, it enters the TERMINATING state and then the TERMINATED state. You can still access the Spark History Server for a terminated session through the GetResourceDashboard operation. |
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 |
|---|---|---|
application_id | string | The ID of the application that the session belongs to. |
region | string | AWS region (default: us-east-1) |
session_id | string | The ID of the session to terminate. |
createdAtAfter | string (date-time) | The lower bound of the option to filter by creation date and time. |
createdAtBefore | string (date-time) | The upper bound of the option to filter by creation date and time. |
maxResults | integer | The maximum number of sessions to return in each page of results. |
nextToken | string | The token for the next set of session results. |
states | array | An optional filter for session states. Note that if this filter contains multiple states, the resulting list will be grouped by the state. |
SELECT examples
- get_session
- list_sessions
Displays detailed information about a session.
SELECT
name,
application_id,
arn,
billed_resource_utilization,
configuration_overrides,
created_at,
created_by,
ended_at,
execution_role_arn,
idle_since,
idle_timeout_minutes,
network_configuration,
release_label,
session_id,
started_at,
state,
state_details,
tags,
total_execution_duration_seconds,
total_resource_utilization,
updated_at
FROM aws.emr_serverless.sessions
WHERE application_id = '{{ application_id }}' -- required
AND session_id = '{{ session_id }}' -- required
AND region = '{{ region }}' -- required
;
Lists sessions for the specified application. You can filter sessions by state and creation time.
SELECT
name,
application_id,
arn,
created_at,
created_by,
execution_role_arn,
release_label,
session_id,
state,
state_details,
updated_at
FROM aws.emr_serverless.sessions
WHERE application_id = '{{ application_id }}' -- required
AND region = '{{ region }}' -- required
AND nextToken = '{{ nextToken }}'
AND maxResults = '{{ maxResults }}'
AND states = '{{ states }}'
AND createdAtAfter = '{{ createdAtAfter }}'
AND createdAtBefore = '{{ createdAtBefore }}'
;
DELETE examples
- terminate_session
Terminates the specified session. After you terminate a session, it enters the TERMINATING state and then the TERMINATED state. You can still access the Spark History Server for a terminated session through the GetResourceDashboard operation.
DELETE FROM aws.emr_serverless.sessions
WHERE application_id = '{{ application_id }}' --required
AND session_id = '{{ session_id }}' --required
AND region = '{{ region }}' --required
;