The AWS CLI tools are used for interacting with the AWS API on the command line. Here's a screenshot of what this can look like, for reference:
Here you're just looking at the results of the
aws --version command followed by
aws ec2 describe-instances.
There are two versions of the AWS CLI tools:
v2 to ensure you're using the latest release candidate and can follow along with any
aws commands we use throughout this book.
In theory you don't actually need the AWS CLI tools to continue following through this book, but they're used and references so often in the real-world that it's important that you understand that they exist, how you can install them and how-to use them.
The quickest and easiest way to install the latest AWS CLI tools (
v2) is using this single command:
1 2 3
After that's complete you'll get a message along these lines:
And if take this suggestion and run the command we get this (your results might vary slightly):
If you've already got the latest
v2 version of the tool, you'll see a message like this when installing:
You can move on and you'll be able to work with this book going forward.
If you're not working with a Ubuntu VM like we are, then you'll have to find and follow the installation instructions that are relevant to your use case.
More platforms and details can be found in the official documentation.
Now that you've (hopefully) installed the AWS CLI tools, you can run the infamous
aws configure command (it's infamous in that you'll see it a lot in tutorials and around the Internet). This command is used to configure you like AWS configuration files, usually located at
The command is simple enough and the answers to the prompts is equally simple:
1 2 3 4 5
You're going to supply the details you got when creating your new IAM User in the previous section, with the exception of two of the prompts: the region and the output format.
For the region the answer will depend on your location. I'm in Brisbane, Australia, so Sydney is my closest region. I therefore pick
ap-southeast-2 as my default region. It's the default region because it's selected when you perform tasks against the AWS API using either the tools we've just installed or Software Development Kit (SDK) that uses the AWS configuration. All this really means is you don't have to set a region every time - your default will be used unless you specify something else.
As for the output format: I simply press Enter and accept the default, which I believe is
None which in turn means "plain text". There are other options but I've never found a need to change this value.
Once you've executed this command and provided details to the prompts you'll have two new files:
There's no need to cover these files in detail at this point. Instead let's move for now.
Now we're going to move into on the topic of Terraform.