Advanced Warning System

That’s not the AWS I am talking about, although my warning in advance is that I found the other AWS pretty cumbersome when I first used it. After scouring quite a few posts it seams the general consensus that this may be by design. Anyway that is something I’ll just have to get used to, as AWS is the leader in public cloud computing and has become a major player in AI, database, machine learning and serverless deployments with the majority market share at 45% for 2019.

https://www.gartner.com/en/newsroom/press-releases/2020-08-10-gartner-says-worldwide-iaas-public-cloud-services-market-grew-37-point-3-percent-in-2019

So for a guy like me with a job in analytics I would silly not to get familiar with their platform. So that is what I have set out to do. You may have noticed that this is my first post in a while, which is for a lot of reasons, but to help me get back sharing stuff I thought that series of small posts detailing my journey exploring and learning the AWS stack might be good. So here we go.

Ok so just to set the context you’ll of course have to sign up to AWS.

https://aws.amazon.com/free/?all-free-tier.sort-by=item.additionalFields.SortRank&all-free-tier.sort-order=asc

Now that you’ve done that my focus with these posts will be on command line interface (CLI). This is because eventually the goal is control the AWS services programatically.

The AWS CLI is built using Python and installation instructions can be found here. I’m using CLI on macOS.

https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html

The next step is to allow the CLI to authenticate with your account. The first thing to get comfortable with is that although you log into the web console using a login and password, this is not the same for the CLI. For the CLI, AWS only uses access keys based on Public Key Cryptography.

https://en.wikipedia.org/wiki/Public-key_cryptography

To get your access keys log into the web console and go to “My Security Credentials”.

Go to “Access keys (access key ID and secret access key)” and create a new access key.

Download your keys.

It must be noted that according to AWS’s best practices these root access keys should not be used, instead it states – “…create one or more AWS Identity and Access Management (IAM) users. Grant those IAM users the necessary permissions and use them for everyday interaction with AWS.

https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html

So in a follow up post I’ll demonstrate how to do that. Ok now that said now that we have the (root) keys lets configure the CLI to use the keys. (I’m using macOS)

From the command line test you have installed the AWS CLI by typing:

aws –version

If that returns a version you should be all set.

Next you need to configure your profile with you access keys. To achieve this type:

aws configure

It will prompt you first to enter the access keys that you downloaded, followed by your default region and the default output type. For default region I picked us-east-1 based on this post –

https://www.concurrencylabs.com/blog/choose-your-aws-region-wisely/

The regions is something I will be exploring further in the future to better understand the pro and cons. The output type can be set to either json, yaml, yaml-stream, text or table.

In the output above you can see that lastly I ran:

aws sts get-caller-identity

to test the authentication. We are now ready to do stuff via the CLI!

All in all that seemed pretty straight forward, but initially wading through the reams of documentation it was pretty overwhelming. So breaking down the process down into smaller sub concepts really helped me, and maybe you too.