SSH into Containers
This guide has steps to SSH into running containers like Flightcontrol Web and Worker service types.
We have a Flightcontrol CLI planned that will make this process much easier.
AWS CLI Setup
- Download and install the AWS CLI from https://aws.amazon.com/cli/.
- Download and install the Session Manager Plugin.
- Configure AWS CLI access, by adding user credentials.
SSH into a container
- Get the region of your service from the Flightcontrol dashboard
- Get the cluster ID of your service from the Flightcontrol dashboard:
- Navigate to the service’s AWS Resources tab in the Service Sidebar
- Find the “ECS Service” resource card
- Copy the short ID from the “ECS Service” card. Example:
rails-app-z880xp2
(Contact support if you need the ID for preview environments)
- Run this command, to list the servers running in your cluster:
aws ecs list-tasks --region <region> --cluster <cluster-id>
- Copy a task ID from the list. The task ID is the last piece for the ARN, like this
arn:aws:ecs:us-east-2:xxxxxx:task/<cluster-name>/<task id>
- Run this command which will get you shell access:
aws ecs execute-command --region <region> --cluster <cluster-id> --container <cluster-id> --task <task-id> --interactive --command "/bin/sh"
- Repeat steps 3 - 5 every time you want shell access.