Day 42 - IAM Programmatic access and AWS CLI ๐Ÿš€ โ˜

Day 42 - IAM Programmatic access and AWS CLI ๐Ÿš€ โ˜

ยท

2 min read

IAM Programmatic access

To access your AWS account from a terminal or system, you can use AWS Access keys and AWS Secret Access keys Watch this video for more details.

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.

  1. Log in to your AWS Management Console.

  2. Click on your username in the top right corner of the console and select "Security Credentials"

  3. Scroll down to Access keys and click on Create access key

  4. The access key is created. Click on Done and download the .csv file cred details


Task-02

Setup and install AWS CLI and configure your account credentials

  1. AWS CLI should be installed in the instance to configure

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

  2. Connect to your Ec2 Instance and use the below commands for Linux

     $ curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
     $ unzip awscliv2.zip
     $ sudo ./aws/install
     $ /usr/local/bin/aws --version
    

  3. AWS CLI is installed now, let's configure it to the Console using the below commands

     $ aws configure
     # Provide the Access Key and Secret Access Key from .csv file
    

  4. Check if the AWS is configured by using the below command

     $ aws s3 ls
     # list the availbe buckets in Aws S3
    

ย