MCPcopy Index your code
hub / github.com/aws/session-manager-plugin

github.com/aws/session-manager-plugin @1.2.835.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 1.2.835.0 ↗ · + Follow
711 symbols 2,212 edges 75 files 373 documented · 52%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Session Manager Plugin

This plugin helps you to use the AWS Command Line Interface (AWS CLI) to start and end sessions to your managed instances. Session Manager is a capability of AWS Systems Manager.

Overview

Session Manager is a fully managed AWS Systems Manager capability that lets you manage your Amazon Elastic Compute Cloud (Amazon EC2) instances, on-premises instances and virtual machines. Session Manager provides secure and auditable instance management without the need to open inbound ports. When you use the Session Manager plugin with the AWS CLI to start a session, the plugin builds the websocket connection to your managed instances.

Prerequisites

Before using Session Manager, make sure your environment meets the following requirements. Complete Session Manager prerequisites.

Starting a session

For information about starting a session using the AWS CLI, see Starting a session (AWS CLI).

Troubleshooting

For information about troubleshooting, see Troubleshooting Session Manager.

Version Compatibility

The default compiled version is 1.3.0.0, which enables all the latest features and functionality for local builds. Official releases use the 1.2.x.x versioning scheme. If you are building locally, we recommend keeping the default version (1.3.0.0) in both VERSION and src/version/version.go to ensure access to all available features.

Working with Docker

To build the Session Manager plugin in a Docker container, complete the following steps:

  1. Install docker

  2. Build the docker image

docker build -t session-manager-plugin-image .
  1. Build the plugin
docker run -it --rm --name session-manager-plugin -v `pwd`:/session-manager-plugin session-manager-plugin-image make release

Working with Linux

To build the binaries required to install the Session Manager plugin, complete the following steps.

  1. Install golang

  2. Install rpm-build and rpmdevtools

  3. Install gcc 8.3+ and glibc 2.27+

  4. Run make release to build the plugin for Linux, Debian, macOS and Windows.

  5. Change to the directory of your local machine's operating system architecture and open the session-manager-plugin directory. Then follow the installation procedure that applies to your local machine. For more information, see Install the Session Manager plugin for the AWS CLI. If the machine you're building the plugin on differs from the machine you plan to install the plugin on you will need to copy the session-manager-plugin binary to the appropriate directory for that operating system.

Linux - /usr/local/sessionmanagerplugin/bin/session-manager-plugin

macOS - /usr/local/sessionmanagerplugin/bin/session-manager-plugin

Windows - C:\Program Files\Amazon\SessionManagerPlugin\bin\session-manager-plugin.exe

The ssmcli binary is available for some operating systems for testing purposes only. The following is an example command using this binary.

./ssmcli start-session --instance-id i-1234567890abcdef0 --region us-east-2

Directory structure

Source code

  • sessionmanagerplugin/session contains the source code for core functionalities
  • communicator/ contains the source code for websocket related operations
  • vendor/src contains the vendor package source code
  • packaging/ contains rpm and dpkg artifacts
  • Tools/src contains build scripts

Feedback

Thank you for helping us to improve the Session Manager plugin. Please send your questions or comments to the Systems Manager Forum

License

The session-manager-plugin is licensed under the Apache 2.0 License.

Extension points exported contracts — how you extend this code

BasicT (Interface)
BasicT represents structs capable of logging messages. This interface matches seelog.LoggerInterface. [2 implementers]
src/log/interface.go
IWebSocketChannel (Interface)
IWebSocketChannel is the interface for DataChannel. [2 implementers]
src/communicator/websocketchannel.go
IWebsocketUtil (Interface)
IWebsocketUtil is the interface for the websocketutil. [1 implementers]
src/websocketutil/websocketutil.go
IPortSession (Interface)
(no doc) [3 implementers]
src/sessionmanagerplugin/session/portsession/portsession.go
SsmCliCommand (Interface)
CliCommand defines the interface for all commands the cli can execute [1 implementers]
src/ssmclicommands/utils/util.go
IDataChannel (Interface)
(no doc) [2 implementers]
src/datachannel/streaming.go
KMSKeyProvider (Interface)
KMSAPI is imported from kmsservice.go It defines the interface for KMS operations
src/encryption/encrypter.go
Retryer (Interface)
(no doc) [1 implementers]
src/retry/retryer.go

Core symbols most depended-on inside this repo

Errorf
called by 174
src/log/interface.go
Error
called by 100
src/log/interface.go
Name
called by 39
src/ssmclicommands/utils/util.go
Debugf
called by 35
src/log/interface.go
Close
called by 33
src/log/interface.go
handleEscapeSequence
called by 28
src/sessionmanagerplugin/session/shellsession/shellsession.go
Infof
called by 22
src/log/interface.go
getSessionMock
called by 15
src/sessionmanagerplugin/session/portsession/test_portsession.go

Shape

Method 328
Function 294
Struct 63
Interface 17
TypeAlias 7
FuncType 2

Languages

Go100%

Modules by API surface

src/datachannel/streaming.go79 symbols
src/datachannel/mocks/IDataChannel.go32 symbols
src/datachannel/streaming_test.go30 symbols
src/message/messageparser_test.go28 symbols
src/communicator/websocketchannel.go28 symbols
src/message/messageparser.go27 symbols
src/log/wrapper.go21 symbols
src/jsonutil/jsonutil_test.go20 symbols
src/sessionmanagerplugin/session/session.go19 symbols
src/log/test_log.go18 symbols
src/sessionmanagerplugin/session/portsession/muxportforwarding.go17 symbols
src/log/interface.go17 symbols

For agents

$ claude mcp add session-manager-plugin \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact