Shawn Mervin

AWS CLI

The AWS CLI is how I run the AWS accounts from a terminal, so deploys and DNS changes are scripted, not clicked.

Visit aws.amazon.com/cliAt the command line

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.

Working with AWS CLI?

Tell me what you're building. Start a project or see the whole stack.

Got an operation that's outgrown its spreadsheets?

Tell me what your business does and where it's jamming up. If I'm not the right person for it, I'll say so and point you somewhere better.

What to send, and what happens next