sessions
Creates, updates, deletes, gets or lists a sessions resource.
Overview
| Name | sessions |
| Type | Resource |
| Id | aws.appstream.sessions |
Fields
The following fields are returned by SELECT queries:
- describe_sessions
| Name | Datatype | Description |
|---|---|---|
authentication_type | string | The authentication method. The user is authenticated using a streaming URL (API) or SAML 2.0 federation (SAML). (API, SAML, USERPOOL, AWS_AD) |
connection_state | string | Specifies whether a user is connected to the streaming session. (CONNECTED, NOT_CONNECTED) |
fleet_name | string | The name of the fleet for the streaming session. |
id | string | The identifier of the streaming session. |
instance_drain_status | string | The drain status of the instance hosting the streaming session. This only applies to multi-session fleets. (ACTIVE, DRAINING, NOT_APPLICABLE) |
instance_id | string | The identifier for the instance hosting the session. |
max_expiration_time | string (date-time) | The time when the streaming session is set to expire. This time is based on the MaxUserDurationinSeconds value, which determines the maximum length of time that a streaming session can run. A streaming session might end earlier than the time specified in SessionMaxExpirationTime, when the DisconnectTimeOutInSeconds elapses or the user chooses to end his or her session. If the DisconnectTimeOutInSeconds elapses, or the user chooses to end his or her session, the streaming instance is terminated and the streaming session ends. |
network_access_configuration | object | Describes the network details of the fleet or image builder instance. |
stack_name | string | The name of the stack for the streaming session. |
start_time | string (date-time) | The time when a streaming instance is dedicated for the user. |
state | string | The current state of the streaming session. (ACTIVE, PENDING, EXPIRED) |
user_id | string | The identifier of the user for whom the session was created. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_sessions | select | region | Retrieves a list that describes the streaming sessions for a specified stack and fleet. If a UserId is provided for the stack and fleet, only streaming sessions for that user are described. If an authentication type is not provided, the default is to authenticate users using a streaming URL. | |
drain_session_instance | exec | region, SessionId | Drains the instance hosting the specified streaming session. The instance stops accepting new sessions while existing sessions continue uninterrupted. Once all sessions end, the instance is reclaimed and replaced. This only applies to multi-session fleets. | |
expire_session | exec | region, SessionId | Immediately stops the specified streaming session. |
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 that describes the streaming sessions for a specified stack and fleet. If a UserId is provided for the stack and fleet, only streaming sessions for that user are described. If an authentication type is not provided, the default is to authenticate users using a streaming URL.
SELECT
authentication_type,
connection_state,
fleet_name,
id,
instance_drain_status,
instance_id,
max_expiration_time,
network_access_configuration,
stack_name,
start_time,
state,
user_id
FROM aws.appstream.sessions
WHERE region = '{{ region }}' -- required
;
Lifecycle Methods
- drain_session_instance
- expire_session
Drains the instance hosting the specified streaming session. The instance stops accepting new sessions while existing sessions continue uninterrupted. Once all sessions end, the instance is reclaimed and replaced. This only applies to multi-session fleets.
EXEC aws.appstream.sessions.drain_session_instance
@region='{{ region }}' --required
@@json=
'{
"SessionId": "{{ SessionId }}"
}'
;
Immediately stops the specified streaming session.
EXEC aws.appstream.sessions.expire_session
@region='{{ region }}' --required
@@json=
'{
"SessionId": "{{ SessionId }}"
}'
;