Created
March 25, 2019 17:42
-
-
Save ob1-sc/153d755772258f39707678726b7cf3cd to your computer and use it in GitHub Desktop.
Access managed ec2 instance via SSM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| JUMPBOX_NAME="<name of ec2 instance>" | |
| INSTANCE_ID=$(aws ec2 describe-instances --filters "Name=tag:Name,Values=$JUMPBOX_NAME" \ | |
| --output text --query 'Reservations[*].Instances[*].InstanceId') | |
| aws ssm start-session --target "$INSTANCE_ID" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment