sessions
Creates, updates, deletes, gets or lists a sessions resource.
Overview
| Name | sessions |
| Type | Resource |
| Id | aws.ssm.sessions |
Fields
The following fields are returned by SELECT queries:
- describe_sessions
| Name | Datatype | Description |
|---|---|---|
access_type | string | Standard access type is the default for Session Manager sessions. JustInTime is the access type for Just-in-time node access. (Standard, JustInTime) |
details | string | Reserved for future use. |
document_name | string | The 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_date | string (date-time) | The date and time, in ISO-8601 Extended format, when the session was terminated. |
max_session_duration | string | The 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_url | object | Reserved for future use. |
owner | string | The ID of the Amazon Web Services user that started the session. |
reason | string | The reason for connecting to the instance. (pattern: <code>^.{1,256}$</code>) |
session_id | string | The ID of the session. |
start_date | string (date-time) | The date and time, in ISO-8601 Extended format, when the session began. |
status | string | The status of the session. For example, "Connected" or "Terminated". (Connected, Connecting, Disconnected, Terminated, Terminating, Failed) |
target | string | The managed node that the Session Manager session connected to. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_sessions | select | region | Retrieves a list of all active sessions (both connected and disconnected) or terminated sessions from the past 30 days. | |
terminate_session | delete | region | 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. |
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
- describe_sessions
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
- terminate_session
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
;