Skip to main content

Simple tool to SSH into an Elastic Beanstalk server using AWS SSM.

Project description

EB SSM

This simple script helps you SSH into an Elastic Beanstalk server using AWS SSM.

While eb ssh exists, it requires each individual user to have the EC2 instance private keys locally. This is unideal from both an information security and access management standpoint. If you've configured SSM, users will no longer need the EC2 instance private keys to SSH into Elastic Beanstalk instances and instead have their access managed via IAM.

eb-ssm is desinged to combine tools from the EB CLI and the AWS CLI to provide a better alternaitve to eb ssh.

Prerequisites

Set up your Elastic Beanstalk Environment to allow SSH via AWS SSM

The following steps need to be done once per environment.

  1. Go to Elastic Beanstalk > ENVIRONEMNT_NAME > Configuration > Security and find the "IAM instance profile" (by default, this is "aws-elasticbeanstalk-ec2-role"). This is ROLE_NAME in step 2.

  2. Go to IAM > Roles > ROLE_NAME. Under permissions, add "AmazonSSMManagedInstanceCore".

  3. Go to Systems Manager > Session Manager > Preferences > Edit. Enable "Run As Support" and set the "Run As Defualt User" to be "ec2-user" (or whatever the default user for your Elastic Beanstalk servers is).

Configure your local computer

The following steps need to be done once per computer.

  1. Install the AWS CLI: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html

  2. Install the Session Manager Plugin: https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html

Using EB SSM

Install eb-ssm via pip install eb-ssm.

Once it is installed, all you need to do is run eb-ssm from your repository and it will automatically hook into your repository's EB configuration (in .elasticbeanstalk/config.yml).

To ssh into a specific environment, use eb-ssm ENVIRONMENT_NAME.

You can also optionally pass other parameters, such as an AWS CLI profile or a region to eb-ssm. See eb-ssm --help for a full list of options.

Config

eb-ssm uses the EB CLI configuration files. If you have not used the EB CLI to set up a project, here is the minimal configruation needed by eb-ssm; this configraution lives in .elasticbeanstalk/config.yml:

global:
  application_name: EB_APPLICATION_NAME
  default_region: REGION_NAME
  profile: PROFILE_NAME

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eb-ssm-1.0.5.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

eb_ssm-1.0.5-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file eb-ssm-1.0.5.tar.gz.

File metadata

  • Download URL: eb-ssm-1.0.5.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.20.1 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.6.10

File hashes

Hashes for eb-ssm-1.0.5.tar.gz
Algorithm Hash digest
SHA256 e204e200daa4e2025f6d9dd8195015c3346075e3c99bf1b1412c15339a037ae5
MD5 49aa5f83257273b6e6ac0978e66863de
BLAKE2b-256 b0f993ec357ccb64b6a88ffeccdb3413d0e6726c033ae24819bdbadadf7314a4

See more details on using hashes here.

File details

Details for the file eb_ssm-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: eb_ssm-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.20.1 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.6.10

File hashes

Hashes for eb_ssm-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 b7ac17c092d309fc385988fee3d71d9335e90a1fbb881a0cbfc42f31152a5cec
MD5 786283217f098640c9053648aaa779c8
BLAKE2b-256 bb1239275bcd843ad56c77d4bd7577278dbe326f5da25438e68a254ba50fde3c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page