What it is
The AWS Command Line Interface is Amazon's official tool for controlling AWS services from a terminal. Almost anything you can do in the web console you can do with a command: create a bucket, upload files, change DNS, deploy a CloudFormation stack or read a bill. Because it is a command, it can go in a script.
The CLI talks to the same APIs as the console and the SDKs, using credentials from named profiles, environment variables or an IAM role. Output comes back as JSON, text or a table, and a built-in query option filters the JSON, which makes it practical to chain one command into the next.
How I use it
- I use it for CloudFront, Route 53 and CloudFormation, and for the dynamic half of mervinc.com, which is one CloudFormation template.
- Every Rental Pilot web deploy builds, syncs to S3, invalidates CloudFront and runs a smoke suite against production before it counts as done.
- Production deploys are scripted and guarded, and refuse to run from unpushed or uncommitted code.
- Separate AWS accounts per business, reached through narrowly scoped IAM users and named profiles.
The AWS CLI is the right tool when an AWS change needs to happen the same way every time, or happen as part of a deploy. I reach for it because nothing in my setup should depend on remembering which console buttons to click, and a script can check its own preconditions before it touches production.
Questions
Can Shawn Mervin automate AWS deployments?
Yes. My web deploys build the app, sync it to S3, invalidate CloudFront and run a smoke suite against production, all from one scripted command using the AWS CLI.
Why use the CLI instead of the AWS console?
A command can be scripted, reviewed and repeated exactly. The console relies on someone remembering the steps, which is where production mistakes come from.