Skip to main content

sessions

Creates, updates, deletes, gets or lists a sessions resource.

Overview

Namesessions
TypeResource
Idaws.emr.sessions

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
account_idstringThe Amazon Web Services account ID that owns the session. (pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>)
arnstringThe Amazon Resource Name (ARN) of the session.
cluster_idstringThe ID of the cluster that the session belongs to.
created_atstring (date-time)The date and time that the session was created.
ended_atstring (date-time)The date and time that the session was terminated or failed.
engine_configurationsarrayThe configuration overrides for the session. Only runtime configuration overrides are supported.
execution_role_arnstringThe 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>)
idstringThe ID of the session.
idle_sincestring (date-time)The date and time that the session last entered the IDLE state.
monitoring_configurationobjectThe monitoring configuration for the session.
namestringThe 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_labelstringThe 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_urlstringThe 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_minutesinteger (int64)The idle timeout, in minutes. If the session is idle for this duration, Amazon EMR automatically terminates it.
started_atstring (date-time)The date and time that the session entered the STARTED state.
statestringThe 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_reasonstringA human-readable message describing the most recent state change. (pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>)
tagsarrayThe tags associated with the session.
updated_atstring (date-time)The date and time that the session was last updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_sessionselectregionReturns detailed information about a session.
list_sessionsselectregionLists the sessions on a cluster. You can filter the results by session state. Newer sessions are returned first.
terminate_sessiondeleteregionTerminates 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.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

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
;

DELETE examples

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
;