# Day 42: IAM Programmatic access and AWS CLI 🚀 ☁

Let's get started with two important tasks: creating AWS access keys and setting up the AWS CLI.

Task 1: Create AWS\_ACCESS\_KEY\_ID and AWS\_SECRET\_ACCESS\_KEY

To begin, we need to generate the AWS\_ACCESS\_KEY\_ID and AWS\_SECRET\_ACCESS\_KEY, which will serve as your credentials for programmatic access to AWS services. Follow these steps:

1. Login to the AWS Management Console.
    
2. Navigate to the IAM service.
    
3. Click on "Users" and select the user for whom you want to create the access keys.  
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1686092769927/bfdf86a4-c7ba-4129-bcde-a163d4b170f1.png align="center")
    
4. Go to the "Security credentials" tab.
    
5. Scroll down to the "Access keys" section and click on "Create access key".
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1686092791841/4a096c5d-a94a-44b5-ab86-de73aba360f0.png align="center")
    
    Select Command Line Interface(CLI) the click Next
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1686092851151/8007e6f0-a58a-4739-bebb-3b5f36ec0582.png align="center")

1. Take note of the generated access key ID and secret access key. These will be used in the next task.
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1686092917919/a84aa85f-7595-4b92-b235-86d2fda2386e.png align="center")

Task 2: Setup and Install AWS CLI

The AWS CLI provides a powerful command-line interface for managing AWS resources and automating tasks. Let's set it up:

1. Install the AWS CLI on your local machine by following the installation instructions for your operating system. You can find the installation guide in the [AWS CLI User Guide](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html).
    
2. Open a terminal or command prompt and run the command "aws configure" to configure your AWS account credentials.
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1686093250200/1241929b-451b-41ef-b787-f72f4065c53c.png align="center")
    
3. Enter the AWS\_ACCESS\_KEY\_ID and AWS\_SECRET\_ACCESS\_KEY obtained from Task 1 when prompted.
    
4. Provide a default region for your AWS CLI operations. You can choose the region that aligns with your use case.
    
5. Optionally, specify an output format for the CLI responses. The default is JSON.
    

Once you have successfully set up the AWS CLI, get ready to tap into its full potential! With the CLI, you can now easily interact with AWS services, efficiently manage your resources, and automate tasks right from the command line.

That was it for today. If you have any queries/suggestion please comment below. See you another day with another challenge.
