Interview Prep/Ansible/Security and Secrets

What does it take to use AWS SSM Session Manager instead of SSH?

AdvancedProductionSecurity and Secrets
Answer

The aws_ssm connection plugin (shipped in the amazon.aws or community.aws collection, depending on version) tunnels commands through SSM, so no inbound port 22, no bastion and no key management are needed.

Requirements: SSM Agent on the instance and an instance profile with AmazonSSMManagedInstanceCore, the session-manager-plugin on the controller, an S3 bucket for module transfer, and controller IAM permissions for ssm:StartSession and the bucket.

[all:vars]
ansible_connection=amazon.aws.aws_ssm
ansible_aws_ssm_bucket_name=acme-ansible-ssm
ansible_aws_ssm_region=ap-south-1

Trade-offs: slower per-task round trips than SSH (consider fewer, larger tasks), and every action is logged in CloudTrail and optionally Session Manager logs, which is useful for audit.

All Ansible questions Roadmap: Ansible

More on Security and Secrets