AWS Systems Manager (SSM) CLI
Remote access
aws ssm start-session --target "i-1234567890abcdef0"
Or to login as ubuntu:
aws ssm start-session --document-name AWS-StartInteractiveCommand \
--parameters '{"command": ["sudo su ubuntu"]}' \
--target i-0cf519030f32da9ab
see ssh.sh