IAM Programmatic access and AWS CLI

IAM Programmatic access and AWS CLI

IAM Programmatic access

IAM (Identity and Access Management) programmatic access refers to the ability to interact with AWS (Amazon Web Services) resources programmatically, typically using APIs (Application Programming Interfaces) or the AWS Command Line Interface (CLI) rather than through the AWS Management Console. When you enable programmatic access for an IAM user or role, you are giving that entity the ability to request AWS services and resources using code. This is particularly useful for automating tasks, managing resources, and integrating AWS services into custom applications or scripts.

AWS CLI

The Amazon Web Services Command Line Interface (AWS CLI) is a powerful tool enabling users to interact directly with various AWS services from the command line. It provides a comprehensive set of commands to manage AWS resources, automate tasks, and integrate AWS functionalities into scripts and workflows.

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.

  • Login to AWS Console: Navigate to the AWS Management Console

  • On the left side, click on "Users."

  • Generate Access Key: Select a user from your list of users.

  • Navigate to the "Security credentials" tab. Under "Access keys," click "Create access key." Choose "Command Line Interface (CLI)" as the use case.

  • Note the Access key ID and Secret access key that are generated. You will need these for AWS CLI configuration.

Task-02: Setup and install AWS CLI and configure your account credentials

  • Install AWS CLI: Download and install the AWS CLI for your operating system. You can find the installation instructions here

  • Configure AWS CLI: Open a terminal or command prompt and run the following command:

aws configure
  • Enter the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY from task 1 when prompted.

  • Specify your preferred region (e.g., us-east-1) and default output format (e.g., JSON)

I've created AWS access keys, installed AWS CLI, and configured my account credentials. I can use AWS CLI commands to interact with my AWS resources.

Thank you!