Your CI job just failed because it couldn’t reach the production EC2 instance. You know the credentials live in Travis CI, but copying SSH keys into an environment variable feels like lighting a security bonfire. There’s a smarter way to reach your remote environments without leaking secrets or breaking compliance.
Amazon EC2 Systems Manager gives you centralized, auditable access to your fleet without direct SSH. It handles automation, patching, and parameter management across instances. Travis CI takes care of building and testing code from your repositories. Pairing the two creates a clean pipeline that can deploy safely into AWS without long-lived credentials or manual approvals.
The integration works through identity and managed session policies. You create an IAM role for Travis CI jobs and grant it the minimal Systems Manager permissions needed, often via ssm:SendCommand and ssm:StartSession. Instead of caching AWS keys, Travis fetches temporary credentials from AWS Security Token Service at runtime. EC2 Systems Manager then handles the encrypted session, runs deployment commands, and tears down access automatically. No one stores a private key, and every action lands in CloudTrail for audit.
If your pipeline involves multiple environments, use parameter hierarchies in Systems Manager. Keep configuration values versioned and restrict decryption rights using AWS KMS and IAM conditions. Rotate parameters regularly and log drift detections into CloudWatch. Most “access denied” errors trace back to IAM roles missing the ssm:DescribeInstanceInformation call, so add that early in troubleshooting.
Featured answer:
To connect EC2 Systems Manager with Travis CI, create an AWS IAM role scoped for Systems Manager commands, attach it to an instance profile or use STS-based temporary credentials, then configure your Travis build to call AWS APIs using those ephemeral tokens. This avoids static credentials and aligns with least-privilege best practices.