Skip to main content

Command Palette

Search for a command to run...

Day 42: IAM Programmatic access and AWS CLI 🚀 ☁

Published
3 min read
Day 42: IAM Programmatic access and AWS CLI 🚀 ☁
A

"I'm a 3rd-year Computer Engineering student at Marwadi University with skills in C++, web development (MERN stack), and DevOps tools like Kubernetes. I contribute to open-source projects and share tech knowledge on GitHub and LinkedIn. I'm learning cloud technologies and app deployment. As an Internshala Student Partner, I help others find jobs and courses." now currently focusing on #90DaysOfDevops

Today is more of a reading excercise and getting some programmatic access for your AWS account

IAM Programmatic access

In order to access your AWS account from a terminal or system, you can use AWS Access keys and AWS Secret Access keys.

AWS CLI

The AWS Command Line Interface (AWS CLI) is a unified tool to manage your AWS services. With just one tool to download and configure, you can control multiple AWS services from the command line and automate them through scripts.

The AWS CLI v2 offers several new features including improved installers, new configuration options such as AWS IAM Identity Center (successor to AWS SSO), and various interactive features.

Task-01

  • Create AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY from AWS Console.

Task-02

  • Setup and install AWS CLI and configure your account credentials

Let me know if you have any issues while doing the task.

Let’s begin with Task-01

Task 01: Create AWS Access Keys

  1. Log in to AWS Management Console:

    • Go to the AWS Management Console.
  2. Navigate to IAM:

    • Click on your username in the top right corner of the console and select "Security Credentials" from the drop-down menu.

  3. Create a New IAM User:

    • Click on the "Access keys (access key ID and secret access key)" section.

    • Click on "Create Access Key".

  1. Download Access Keys:

    • Your Access Key ID and Secret Access Key will be displayed. Download the CSV file containing the access key information and store it in a secure location.

Let’s begin with Task 02

  1. Launch EC2 instance with below configuration

    • AMI: Ubuntu

    • Instance Type: t2.micro

    • Network Settings: Allow HTTP and HTTPS traffic

  2. Download and Install AWS CLI:

    sudo apt update
    sudo apt install unzip

To install the AWS CLI, run the following commands.

    curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
    unzip awscliv2.zip
    sudo ./aws/install
  1. Check AWS CLI Version:

    • Open your terminal or command prompt and run the following command:

          aws --version
      
    • Ensure that AWS CLI is installed correctly and the version is displayed.

  2. Configure AWS CLI:

    • Run the command:

          aws configure
      
    • Enter your AWS Access Key ID, AWS Secret Access Key, Default region name, and Default output format when prompted.

Example:

    $ aws configure
    AWS Access Key ID [None]: <Your_Access_Key_ID>
    AWS Secret Access Key [None]: <Your_Secret_Access_Key>
    Default region name [None]: us-west-2
    Default output format [None]: json
  1. Verify Configuration:

    • Run a simple AWS CLI command to verify the setup:

      Copy

      Copy

          aws s3 ls
      
    • This command lists your S3 buckets. If configured correctly, you should see a list of your S3 buckets or an empty list if you don't have any.

Thankyou for reading !!!!!

90DaysOfDevops

Part 4 of 49

So In This Series I am following 90 DaysOfDevops challenge , what i will learn in my devops journey i will share with you with my blogs ,You will get blog on tools which used by devops engineer , example :- Linux,ansible,terraform,docker,etc

Up next

Day 41: Setting up an Application Load Balancer with AWS EC2 🚀 ☁

Hi, I hope you had a great day yesterday learning about the launch template and instances in EC2. Today, we are going to dive into one of the most important concepts in EC2: Load Balancing. What is Load Balancing? Load balancing is the distribution o...

More from this blog

A

Anand Raval

118 posts

Hello I am Anand Raval , i contributed my work in robotics(arduino uno) , fronted web devloper,competitive programming, now currently focusing on #90DaysOfDevops