Day 42: IAM Programmatic Access and AWS CLIπŸš€ ☁

Day 42: IAM Programmatic Access and AWS CLIπŸš€ ☁

Β·

2 min read

Today is more of a reading exercise and getting some programmatic access to your AWS account

IAM Programmatic Access

  • IAM programmatic access refers to the ability to interact with Amazon Web Services (AWS) resources programmatically through various software development kits (SDKs), command-line interfaces (CLIs), and directly via API requests.

  • To enable programmatic access for a user, group, or service, you create AWS Identity and Access Management (IAM) users and assign them the necessary permissions by attaching policies to their accounts.

  • For example, AWS CLI, AWS SDKs for various programming languages, and third-party applications can use IAM programmatic access to perform tasks, manage resources, and automate AWS operations.

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

Create AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY from AWS Console.

Setup and install AWS CLI and configure your account credentials

Step 1: Create AWS Access Keys

  • Sign in to the AWS Management Console. And open the AWS Identity and Access Management (IAM) console.

  • In the navigation pane, choose Users. Choose the name of the user that you want to create access keys for.

  • In the Security credentials tab, under the Access keys section, choose Create access key.

  • You will see the Access key ID and Secret access key. Make sure to save the "Secret access key" securely, as you won't be able to view it again.

Step 2: Install AWS CLI

  • Install the AWS CLI on your local machine. You can find installation instructions for different platforms here.

  • After installation, open your terminal or command prompt.

Step 3: Configure AWS CLI

  • Run the following command to configure the AWS CLI:

      aws configure
    

    It will give you information about the AWS Access Key ID, AWS Secret Access Key, Default region name (e.g., us-east-1) and Default output format (e.g., JSON).

  • Enter the Access Key ID and Secret Access Key you generated earlier.

  • Set your desired region and output format.

Now, your AWS CLI is configured with your account credentials. You can use the AWS CLI to interact with AWS services using the access keys and secret access keys you've provided during configuration.


<That's all for today. Hope you like it. FOLLOW to join me in the journey of DevOps>

Β