Skip to content

AleMercadal/aws-ssm-connect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AWS SSM Connect

Simple bash script to connect to EC2 instances via AWS Systems Manager Session Manager.

Why?

Skip looking up instance IDs in the console. Just search by name:

aws-ssm-connect web-server

Prerequisites

Installation

Quick install:

curl -o /usr/local/bin/aws-ssm-connect https://raw.githubusercontent.com/AleMercadal/aws-ssm-connect/main/bin/aws-ssm-connect
chmod +x /usr/local/bin/aws-ssm-connect

Or with make:

git clone https://github.com/AleMercadal/aws-ssm-connect.git
cd aws-ssm-connect
make install

Usage

# Basic usage
aws-ssm-connect web-server

# With AWS profile
aws-ssm-connect web-server --profile production

# With region
aws-ssm-connect web-server --region us-west-2

# Help
aws-ssm-connect --help

Required Permissions

Your IAM user/role needs:

{
  "Effect": "Allow",
  "Action": ["ec2:DescribeInstances", "ssm:StartSession"],
  "Resource": "*"
}

Your EC2 instances need:

  • IAM instance profile with AmazonSSMManagedInstanceCore policy
  • SSM Agent running (pre-installed on most AMIs)

Troubleshooting

Can't connect?

  • Instance must be in "running" state
  • SSM Agent must be running
  • Instance needs correct IAM role
  • If you added the IAM policy after launching the instance and it still doesn't appear in Session Manager, reboot the instance so the SSM Agent can register properly

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published