sessions
Creates, updates, deletes, gets or lists a sessions resource.
Overview
| Name | sessions |
| Type | Resource |
| Id | aws.emr.sessions |
Fields
The following fields are returned by SELECT queries:
- get_session
- list_sessions
| Name | Datatype | Description |
|---|---|---|
account_id | string | The Amazon Web Services account ID that owns the session. (pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>) |
arn | string | The Amazon Resource Name (ARN) of the session. |
cluster_id | string | The ID of the cluster that the session belongs to. |
created_at | string (date-time) | The date and time that the session was created. |
ended_at | string (date-time) | The date and time that the session was terminated or failed. |
engine_configurations | array | The configuration overrides for the session. Only runtime configuration overrides are supported. |
execution_role_arn | string | The execution role ARN for the session. Amazon EMR uses this role to access Amazon Web Services resources on your behalf during session execution. (pattern: <code>^arn:(aws[a-zA-Z0-9-]*):iam::(\d{12})?:(role((\u002F)|(\u002F[\u0021-\u007F]+\u002F))[\w+=,.@-]+)$</code>) |
id | string | The ID of the session. |
idle_since | string (date-time) | The date and time that the session last entered the IDLE state. |
monitoring_configuration | object | The monitoring configuration for the session. |
name | string | The name of the session, if one was provided at creation time. (pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>) |
release_label | string | The Amazon EMR release label of the cluster that the session is running on. (pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>) |
server_url | string | The Spark Connect server URL for the session. Use this URL with the Credentials returned by GetSessionEndpoint to connect directly to the session over VPC peering. (pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>) |
session_idle_timeout_in_minutes | integer (int64) | The idle timeout, in minutes. If the session is idle for this duration, Amazon EMR automatically terminates it. |
started_at | string (date-time) | The date and time that the session entered the STARTED state. |
state | string | The current state of the session. Valid values are SUBMITTED, STARTING, STARTED, IDLE, BUSY, TERMINATING, TERMINATED, and FAILED. (SUBMITTED, STARTING, STARTED, IDLE, BUSY, TERMINATING, TERMINATED, FAILED) |
state_change_reason | string | A human-readable message describing the most recent state change. (pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>) |
tags | array | The tags associated with the session. |
updated_at | string (date-time) | The date and time that the session was last updated. |
| Name | Datatype | Description |
|---|---|---|
account_id | string | The Amazon Web Services account ID that owns the session. (pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>) |
arn | string | The Amazon Resource Name (ARN) of the session. |
cluster_id | string | The ID of the cluster that the session belongs to. |
created_at | string (date-time) | The date and time that the session was created. |
ended_at | string (date-time) | The date and time that the session was terminated or failed. |
engine_configurations | array | The configuration overrides for the session. Only runtime configuration overrides are supported. |
execution_role_arn | string | The execution role ARN for the session. Amazon EMR uses this role to access Amazon Web Services resources on your behalf during session execution. (pattern: <code>^arn:(aws[a-zA-Z0-9-]*):iam::(\d{12})?:(role((\u002F)|(\u002F[\u0021-\u007F]+\u002F))[\w+=,.@-]+)$</code>) |
id | string | The ID of the session. |
idle_since | string (date-time) | The date and time that the session last entered the IDLE state. |
monitoring_configuration | object | The monitoring configuration for the session. |
name | string | The name of the session, if one was provided at creation time. (pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>) |
release_label | string | The Amazon EMR release label of the cluster that the session is running on. (pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>) |
server_url | string | The Spark Connect server URL for the session. Use this URL with the Credentials returned by GetSessionEndpoint to connect directly to the session over VPC peering. (pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>) |
session_idle_timeout_in_minutes | integer (int64) | The idle timeout, in minutes. If the session is idle for this duration, Amazon EMR automatically terminates it. |
started_at | string (date-time) | The date and time that the session entered the STARTED state. |
state | string | The current state of the session. Valid values are SUBMITTED, STARTING, STARTED, IDLE, BUSY, TERMINATING, TERMINATED, and FAILED. (SUBMITTED, STARTING, STARTED, IDLE, BUSY, TERMINATING, TERMINATED, FAILED) |
state_change_reason | string | A human-readable message describing the most recent state change. (pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>) |
tags | array | The tags associated with the session. |
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 | region | Returns detailed information about a session. | |
list_sessions | select | region | Lists the sessions on a cluster. You can filter the results by session state. Newer sessions are returned first. | |
terminate_session | delete | region | Terminates an active session. After you call this operation, the session enters the TERMINATING state and then transitions to TERMINATED. |
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
Returns detailed information about a session.
SELECT
account_id,
arn,
cluster_id,
created_at,
ended_at,
engine_configurations,
execution_role_arn,
id,
idle_since,
monitoring_configuration,
name,
release_label,
server_url,
session_idle_timeout_in_minutes,
started_at,
state,
state_change_reason,
tags,
updated_at
FROM aws.emr.sessions
WHERE region = '{{ region }}' -- required
;
Lists the sessions on a cluster. You can filter the results by session state. Newer sessions are returned first.
SELECT
account_id,
arn,
cluster_id,
created_at,
ended_at,
engine_configurations,
execution_role_arn,
id,
idle_since,
monitoring_configuration,
name,
release_label,
server_url,
session_idle_timeout_in_minutes,
started_at,
state,
state_change_reason,
tags,
updated_at
FROM aws.emr.sessions
WHERE region = '{{ region }}' -- required
;
DELETE examples
- terminate_session
Terminates an active session. After you call this operation, the session enters the TERMINATING state and then transitions to TERMINATED.
DELETE FROM aws.emr.sessions
WHERE region = '{{ region }}' --required
;