amazonka-ssm-2.0: Amazon Simple Systems Manager (SSM) SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Amazonka.SSM.StartSession

Description

Initiates a connection to a target (for example, a managed node) for a Session Manager session. Returns a URL and token that can be used to open a WebSocket connection for sending input and receiving outputs.

Amazon Web Services CLI usage: start-session is an interactive command that requires the Session Manager plugin to be installed on the client machine making the call. For information, see Install the Session Manager plugin for the Amazon Web Services CLI in the Amazon Web Services Systems Manager User Guide.

Amazon Web Services Tools for PowerShell usage: Start-SSMSession isn't currently supported by Amazon Web Services Tools for PowerShell on Windows local machines.

Synopsis

Creating a Request

data StartSession Source #

See: newStartSession smart constructor.

Constructors

StartSession' 

Fields

  • documentName :: Maybe Text

    The name of the SSM document you want to use to define the type of session, input parameters, or preferences for the session. For example, SSM-SessionManagerRunShell. You can call the GetDocument API to verify the document exists before attempting to start a session. If no document name is provided, a shell to the managed node is launched by default. For more information, see Start a session in the Amazon Web Services Systems Manager User Guide.

  • parameters :: Maybe (HashMap Text [Text])

    The values you want to specify for the parameters defined in the Session document.

  • reason :: Maybe Text

    The reason for connecting to the instance. This value is included in the details for the Amazon CloudWatch Events event created when you start the session.

  • target :: Text

    The managed node to connect to for the session.

Instances

Instances details
ToJSON StartSession Source # 
Instance details

Defined in Amazonka.SSM.StartSession

ToHeaders StartSession Source # 
Instance details

Defined in Amazonka.SSM.StartSession

ToPath StartSession Source # 
Instance details

Defined in Amazonka.SSM.StartSession

ToQuery StartSession Source # 
Instance details

Defined in Amazonka.SSM.StartSession

AWSRequest StartSession Source # 
Instance details

Defined in Amazonka.SSM.StartSession

Associated Types

type AWSResponse StartSession #

Generic StartSession Source # 
Instance details

Defined in Amazonka.SSM.StartSession

Associated Types

type Rep StartSession :: Type -> Type #

Read StartSession Source # 
Instance details

Defined in Amazonka.SSM.StartSession

Show StartSession Source # 
Instance details

Defined in Amazonka.SSM.StartSession

NFData StartSession Source # 
Instance details

Defined in Amazonka.SSM.StartSession

Methods

rnf :: StartSession -> () #

Eq StartSession Source # 
Instance details

Defined in Amazonka.SSM.StartSession

Hashable StartSession Source # 
Instance details

Defined in Amazonka.SSM.StartSession

type AWSResponse StartSession Source # 
Instance details

Defined in Amazonka.SSM.StartSession

type Rep StartSession Source # 
Instance details

Defined in Amazonka.SSM.StartSession

type Rep StartSession = D1 ('MetaData "StartSession" "Amazonka.SSM.StartSession" "amazonka-ssm-2.0-Ak65QSGRhJDC5x7UvsCpi8" 'False) (C1 ('MetaCons "StartSession'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "documentName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "parameters") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe (HashMap Text [Text])))) :*: (S1 ('MetaSel ('Just "reason") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "target") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text))))

newStartSession Source #

Create a value of StartSession with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

StartSession, startSession_documentName - The name of the SSM document you want to use to define the type of session, input parameters, or preferences for the session. For example, SSM-SessionManagerRunShell. You can call the GetDocument API to verify the document exists before attempting to start a session. If no document name is provided, a shell to the managed node is launched by default. For more information, see Start a session in the Amazon Web Services Systems Manager User Guide.

StartSession, startSession_parameters - The values you want to specify for the parameters defined in the Session document.

StartSession, startSession_reason - The reason for connecting to the instance. This value is included in the details for the Amazon CloudWatch Events event created when you start the session.

StartSession, startSession_target - The managed node to connect to for the session.

Request Lenses

startSession_documentName :: Lens' StartSession (Maybe Text) Source #

The name of the SSM document you want to use to define the type of session, input parameters, or preferences for the session. For example, SSM-SessionManagerRunShell. You can call the GetDocument API to verify the document exists before attempting to start a session. If no document name is provided, a shell to the managed node is launched by default. For more information, see Start a session in the Amazon Web Services Systems Manager User Guide.

startSession_parameters :: Lens' StartSession (Maybe (HashMap Text [Text])) Source #

The values you want to specify for the parameters defined in the Session document.

startSession_reason :: Lens' StartSession (Maybe Text) Source #

The reason for connecting to the instance. This value is included in the details for the Amazon CloudWatch Events event created when you start the session.

startSession_target :: Lens' StartSession Text Source #

The managed node to connect to for the session.

Destructuring the Response

data StartSessionResponse Source #

See: newStartSessionResponse smart constructor.

Constructors

StartSessionResponse' 

Fields

  • sessionId :: Maybe Text

    The ID of the session.

  • streamUrl :: Maybe Text

    A URL back to SSM Agent on the managed node that the Session Manager client uses to send commands and receive output from the node. Format: wss://ssmmessages.region.amazonaws.com/v1/data-channel/session-id?stream=(input|output)

    region represents the Region identifier for an Amazon Web Services Region supported by Amazon Web Services Systems Manager, such as us-east-2 for the US East (Ohio) Region. For a list of supported region values, see the Region column in Systems Manager service endpoints in the Amazon Web Services General Reference.

    session-id represents the ID of a Session Manager session, such as 1a2b3c4dEXAMPLE.

  • tokenValue :: Maybe Text

    An encrypted token value containing session and caller information. This token is used to authenticate the connection to the managed node, and is valid only long enough to ensure the connection is successful. Never share your session's token.

  • httpStatus :: Int

    The response's http status code.

Instances

Instances details
Generic StartSessionResponse Source # 
Instance details

Defined in Amazonka.SSM.StartSession

Associated Types

type Rep StartSessionResponse :: Type -> Type #

Read StartSessionResponse Source # 
Instance details

Defined in Amazonka.SSM.StartSession

Show StartSessionResponse Source # 
Instance details

Defined in Amazonka.SSM.StartSession

NFData StartSessionResponse Source # 
Instance details

Defined in Amazonka.SSM.StartSession

Methods

rnf :: StartSessionResponse -> () #

Eq StartSessionResponse Source # 
Instance details

Defined in Amazonka.SSM.StartSession

type Rep StartSessionResponse Source # 
Instance details

Defined in Amazonka.SSM.StartSession

type Rep StartSessionResponse = D1 ('MetaData "StartSessionResponse" "Amazonka.SSM.StartSession" "amazonka-ssm-2.0-Ak65QSGRhJDC5x7UvsCpi8" 'False) (C1 ('MetaCons "StartSessionResponse'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "sessionId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "streamUrl") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text))) :*: (S1 ('MetaSel ('Just "tokenValue") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int))))

newStartSessionResponse Source #

Create a value of StartSessionResponse with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

StartSessionResponse, startSessionResponse_sessionId - The ID of the session.

$sel:streamUrl:StartSessionResponse', startSessionResponse_streamUrl - A URL back to SSM Agent on the managed node that the Session Manager client uses to send commands and receive output from the node. Format: wss://ssmmessages.region.amazonaws.com/v1/data-channel/session-id?stream=(input|output)

region represents the Region identifier for an Amazon Web Services Region supported by Amazon Web Services Systems Manager, such as us-east-2 for the US East (Ohio) Region. For a list of supported region values, see the Region column in Systems Manager service endpoints in the Amazon Web Services General Reference.

session-id represents the ID of a Session Manager session, such as 1a2b3c4dEXAMPLE.

$sel:tokenValue:StartSessionResponse', startSessionResponse_tokenValue - An encrypted token value containing session and caller information. This token is used to authenticate the connection to the managed node, and is valid only long enough to ensure the connection is successful. Never share your session's token.

$sel:httpStatus:StartSessionResponse', startSessionResponse_httpStatus - The response's http status code.

Response Lenses

startSessionResponse_streamUrl :: Lens' StartSessionResponse (Maybe Text) Source #

A URL back to SSM Agent on the managed node that the Session Manager client uses to send commands and receive output from the node. Format: wss://ssmmessages.region.amazonaws.com/v1/data-channel/session-id?stream=(input|output)

region represents the Region identifier for an Amazon Web Services Region supported by Amazon Web Services Systems Manager, such as us-east-2 for the US East (Ohio) Region. For a list of supported region values, see the Region column in Systems Manager service endpoints in the Amazon Web Services General Reference.

session-id represents the ID of a Session Manager session, such as 1a2b3c4dEXAMPLE.

startSessionResponse_tokenValue :: Lens' StartSessionResponse (Maybe Text) Source #

An encrypted token value containing session and caller information. This token is used to authenticate the connection to the managed node, and is valid only long enough to ensure the connection is successful. Never share your session's token.