The app server app runs in private-a with an instance profile for Session Manager.
-
Keep its id in
ID:shID=$(aws ec2 describe-instances --filters Name=tag:Name,Values=app --query "Reservations[0].Instances[0].InstanceId" --output text) -
Try to start a session with it, and read the error.
-
Give the private subnets a way out. The gateway goes in
public-a:shSUBNET=$(aws ec2 describe-subnets --filters Name=tag:Name,Values=public-a --query "Subnets[0].SubnetId" --output text) -
Check the gateway until it is
available. -
The route goes in the
privatetable:shRT=$(aws ec2 describe-route-tables --filters Name=tag:Name,Values=private --query "RouteTables[0].RouteTableId" --output text) -
Start a session with
appagain. Inside it, fetch a page from the internet and save it, thenexit:shcurl -s https://example.com > /tmp/example.html