AWS CLI and SDK - Setup for Devs

AWS Aug 20, 2021

Before one embarks on a Journey to explore the plethora of services, heading towards innovation, the biggest obstacle for any developer is setting up their system.

Sometimes going through vast expanse of documentation can prove to be extremely exhaustive.

This article aims at bringing together all the necessary pieces to setup your Local System to be able to leverage and explore the variety of services offered by AWS.

Step 0: Create an Account

If you already have an account feel free to skip this step. But for all those for whom this a first time, please go ahead and create you account here.

When you SignUp for AWS you are by default signed up for all AWS Services. Though you would have to pay for what you use.
If you are a new customer, you can always explore and use the Free Tier to save money and perform necessary experimentation.
Follow the online Instructions for Signing Up. Make sure you note your Project ID.

In case you forget, no need to worry. It will always showcase on the top right corner along with your Username.

Step 1: Create IAM User

It is highly recommended that you access your AWS with AWS Identity and Access Management (IAM) credentials instead of your user console credentials.

To use IAM to access AWS follow the following steps -

  1. Create an IAM user
  2. Add the user to an IAM group with administrative permissions
  3. Grant administrative permissions to the IAM user
  4. You can then access AWS using a special URL and the IAM user's credentials.

To create an administrator user and sign in to the console

  1. Create an administrator user called adminuser in your AWS account. For instructions, see Creating Your First IAM User and Administrators Group in the IAM User Guide.
  2. Sign in to the AWS Management Console using a special URL. For more information, see How Users Sign In to Your Account in the IAM User Guide.

Step 2: Setup for AWS SDK

In the previous step where you created the IAM AdminUser, you should have received the following 2 details -

  1. Admin User Access Key Id - AWS Access Key ID
  2. Admin User Secret Access Key - AWS Secret Access Key

One you have received the 2 credentials, the only things that remains is exporting these Environment Variables to your system.

You can either add to your current session by -

export AWS_ACCESS_KEY_ID=<your-admin-user-access-key>
export AWS_SECRET_ACCESS_KEY=<your-admin-user-secret-access-key>

Or you can add the same to your Profile config that you use in your Terminal. For Mac / Linux Users it would be either .zsh_profile or .bash_profile

Step 3: Optional Setup AWS CLI

This is again Optional. If you intend on using Boto3 which is a part of AWS Python SDK then AWS CLI may not be the best of interest for you.

Whereas there are certain services and features which are offered only in AWS CLI.

Download and configure the AWS CLI. For instructions, see the following topics in the AWS Command Line Interface User Guide:

  1. Getting set up with the AWS Command Line Interface
  2. Configuring the AWS Command Line Interface

In the AWS CLI config file, add a named profile for the administrator user:

[profile adminuser]
aws_access_key_id = adminuser access key ID
aws_secret_access_key = adminuser secret access key
region = aws-region

Verify your setup by running -

aws help

Step 4: Install the Client Libraries

As a Developer under most circumstances you may end up utilising the Boto3 SDK of AWS for building cutting edge solutions.

So all you need to do now is install the Boto3 package and Enjoy.

pip3 install boto3

You can find the detailed documentation of Boto3 right here.

Step 5: Enjoy your Hard Work

Now that everything is set. Go ahead and kickstart your journey and explore the variety of services offered by AWS and build cutting edge solutions for the society.

STAY TUNED for more content around AWS. 😁


Vaibhav Satpathy

AI Enthusiast and Explorer

Great! You've successfully subscribed.
Great! Next, complete checkout for full access.
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.