π Introduction:
In this blog, we will go deep dive into what IAM programmatic access is and how to use AWS CLI, a unified tool to manage your AWS services from the command line.
IAM Programmatic Access
IAM (Identity and Access Management) programmatic access refers to the ability for applications, scripts, or command-line tools to interact with AWS services on behalf of a user or system. Programmatic access allows you to perform actions and manage resources in your AWS environment without requiring manual intervention.
When you enable IAM programmatic access for a user or system, you are essentially providing them with API (Application Programming Interface) access credentials. These credentials typically include an Access Key ID and a Secret Access Key.
The Access Key ID is used to identify the user or system making requests.
The Secret Access Key is a secret key used to sign the requests.
Once IAM programmatic access is set up, you can use these credentials to make API calls to AWS services, such as creating and managing EC2 instances, uploading files to S3 buckets, or configuring security policies. This is particularly useful for automation, scripting, and integrating AWS services into custom applications.
AWS CLI
You can use these access keys to authenticate your requests to AWS and authorize your actions on AWS resources. You can also rotate or delete your access keys as needed to maintain the security of your AWS account.
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: 1
Create AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY from AWS Console.
Log in to your AWS Management Console.
Click on your username in the top right corner of the console and select Security Credentials from the drop-down menu.
- Go to the Access keys section and click on Create Access key
- Click on Create Access Key
- Your access key ID and secret access key will be displayed. Make sure to download the CSV file with your access key information and store it in a secure location.
π―Task: 2
Setup and install AWS CLI and configure your account credentials
- Install the AWS CLI by following the instructions for your operating system
https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
sudo apt install unzip
unzip awscliv2.zip
sudo ./aws/install
- Check aws-cli version
To configure your account credentials
You will be prompted to enter your AWS Access Key ID and Secret Access Key. Copy and paste the access key and secret key from a downloaded CSV file.
You will also be prompted to enter your default region and output format. Choose the region that is closest to your location and select a suitable output format.
- we can verify your AWS CLI is working
π Conclusion :
In this blog, we cover what IAM programmatic access is and how to use AWS CLI, how to generate Access Key ID and a Secret Access Key & configure AWS CLI the next blog we will cover AWS Advanced Topics.
Thank you for reading!
Contact me on Linkedin
Check out my GitHub for more resources π