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

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

ยท

3 min read

Today is more of a reading exercise 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.

Created IAM user

Command Level Interface(CLI):

By using this Access key and Secret Key,AWS CLI can be configured.

This is the access key and description why we created this key.

Task-02

  • Setup and install AWS CLI and configure your account credentials

To install or update the AWS CLI for Windows

  1. If you currently have the AWS CLI installed, determine which version that you have installed.

     aws --version
    
  2. If you have an earlier version of AWS CLI, then use the following command to install the latest AWS CLI version 2. For other installation options, or to upgrade your currently installed version 2, see Upgrading the AWS CLI version 2 on Windows.

    1. Download the AWS CLI MSI installer for Windows (64-bit) at https://awscli.amazonaws.com/AWSCLIV2.msi

    2. Run the downloaded MSI installer and follow the onscreen instructions. By default, the AWS CLI installs to C:\Program Files\Amazon\AWSCLIV2.

If you're unable to use the AWS CLI version 2, then ensure that you have the latest version of the AWS CLI version 1 installed using the following command.

    pip3 install --user --upgrade awscli

Configure your AWS CLI credentials

Both eksctl and the AWS CLI require that you have AWS credentials configured in your environment. The aws configure command is the fastest way to set up your AWS CLI installation for general use.

$ aws configure
AWS Access Key ID [None]: <AKIAIOSFODNN7EXAMPLE>
AWS Secret Access Key [None]: <wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY>
Default region name [None]: <region-code>
Default output format [None]:

When you type this command, the AWS CLI prompts you for four pieces of information: Access key, secret access key, AWS Region, and output format. This information is stored in a profile (a collection of settings) named default. This profile is used when you run commands unless you specify another one. For more information, see Configuring the AWS CLI in the AWS Command Line Interface User Guide.

Thank you for reading!! Hope you find this helpful.

#day42#90daysofdevops#devopscommunity#trainwithshubham

Shubham Londhe

ย