Skip to main content

sessions

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

Overview

Namesessions
TypeResource
Idaws.ssm.sessions

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
access_typestringStandard access type is the default for Session Manager sessions. JustInTime is the access type for Just-in-time node access. (Standard, JustInTime)
detailsstringReserved for future use.
document_namestringThe name of the Session Manager SSM document used to define the parameters and plugin settings for the session. For example, SSM-SessionManagerRunShell. (pattern: <code>^[a-zA-Z0-9_-.]{3,128}$</code>)
end_datestring (date-time)The date and time, in ISO-8601 Extended format, when the session was terminated.
max_session_durationstringThe maximum duration of a session before it terminates. (pattern: <code>^([1-9]|[1-9][0-9]|[1-9][0-9][0-9]|1[0-4][0-3][0-9]|1440)$</code>)
output_urlobjectReserved for future use.
ownerstringThe ID of the Amazon Web Services user that started the session.
reasonstringThe reason for connecting to the instance. (pattern: <code>^.{1,256}$</code>)
session_idstringThe ID of the session.
start_datestring (date-time)The date and time, in ISO-8601 Extended format, when the session began.
statusstringThe status of the session. For example, "Connected" or "Terminated". (Connected, Connecting, Disconnected, Terminated, Terminating, Failed)
targetstringThe managed node that the Session Manager session connected to.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_sessionsselectregionRetrieves a list of all active sessions (both connected and disconnected) or terminated sessions from the past 30 days.
terminate_sessiondeleteregionPermanently ends a session and closes the data connection between the Session Manager client and SSM Agent on the managed node. A terminated session can't be resumed.

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

Retrieves a list of all active sessions (both connected and disconnected) or terminated sessions from the past 30 days.

SELECT
access_type,
details,
document_name,
end_date,
max_session_duration,
output_url,
owner,
reason,
session_id,
start_date,
status,
target
FROM aws.ssm.sessions
WHERE region = '{{ region }}' -- required
;

DELETE examples

Permanently ends a session and closes the data connection between the Session Manager client and SSM Agent on the managed node. A terminated session can't be resumed.

DELETE FROM aws.ssm.sessions
WHERE region = '{{ region }}' --required
;