CmdID

CmdID / aws / aws ssm

aws ssm start-session

Initiates a connection to a target (for example, a managed node) for a Session Manager session. AWS CLI reference

2 examples 4 options Its page in the AWS CLI reference

Opens CmdID with your command. It is read in your browser and sent nowhere.

Examples

from aws-cli, each command read by CmdID

Example 1: To start a Session Manager session

The following start-session example establishes a connection with an instance for a Session Manager session. Note that this interactive command requires the Session Manager plugin to be installed on the client machine making the call.

aws ssm start-session --target "i-1234567890abcdef0"Identify
--targetThe managed node to connect to for the session.
Its output
Starting session with SessionId: Jane-Roe-07a16060613c408b5

Example 2: To start a Session Manager session using SSH

The following start-session example establishes a connection with an instance for a Session Manager session using SSH. Note that this interactive command requires the Session Manager plugin to be installed on the client machine making the call, and that the command uses the default user on the instance, such as ec2-user for EC2 instances for Linux.

ssh -i /path/my-key-pair.pem ec2-user@i-02573cafcfEXAMPLE
Its output
Starting session with SessionId: ec2-user-07a16060613c408b5

For more information, see Start a Session and Install the Session Manager Plugin for the AWS CLI in the AWS Systems Manager User Guide.

Options

4 in the AWS CLI reference
--document-nameThe name of the SSM document you want to use to define the type of session, input parameters, or preferences for the session.
--parametersThe values you want to specify for the parameters defined in the Session document.
--reasonThe reason for connecting to the instance.
--targetThe managed node to connect to for the session.