Minimal AWS CLI Installation Guide

amazon-web-servicesautomationaws-cli

Sometimes I'd like to spin up an instance and run an aws cli command on it quickly, but there seems to be a great delay in installing the aws cli. Is there any way to get a "minimal" installation that omits the many files unnecessary in an automated deploy/test, for example all the example files? Or maybe even versions of the cli that only contain a single command, such as s3 or ec2?

Note that the instances are not running in AWS EC2, and I don't have control over the images, or I would use images with the AWS CLI pre-installed. Also note that the services I need to use are S3 and CloudFront.

Best Answer

I don't think so, most of the dependencies are used by most of the AWS CLI commands I'd suspect so installing a trimmed down version won't really help much.

But you can either:

  1. Use an AMI that comes with AWS CLI already installed - e.g. Amazon Linux 2

  2. Create your own AMI with AWS CLI installed and use that as your base image - simply spin up an instance from the image of your choice, install AWS CLI, do Create Image (= creates a new AMI) and use that for your experiments.

  3. Use service-specific tools such as s3cmd or EB CLI that may require fewer dependencies.

Hope that helps :)