How do you open a shell or port-forward to a private instance without SSH?
BeginnerProductionRapid-Fire AWS CLI
Answer
aws ssm start-session --target i-0abc123def4567890
# Port-forward through an instance to a private RDS endpoint
aws ssm start-session --target i-0abc123def4567890 \
--document-name AWS-StartPortForwardingSessionToRemoteHost \
--parameters '{"host":["orders.cluster-xyz.eu-west-1.rds.amazonaws.com"],"portNumber":["5432"],"localPortNumber":["15432"]}'
Requires the Session Manager plugin installed locally.
More on Rapid-Fire AWS CLI
How do you check which identity and account the CLI is using?BeginnerHow do you log in with Identity Center (SSO) from the CLI?BeginnerHow do you assume a role manually and export the credentials?IntermediateHow do you list running instances with name, ID, type and private IP in a table?BeginnerHow do you find the latest Amazon Linux 2023 AMI without hard-coding an ID?BeginnerHow do you run a command on a fleet of instances by tag?Beginner