IAM Programmatic access and AWS CLI ๐
This is Day 42 of #90daysofdevops challenge
Today is more of a reading exercise and getting some programmatic access for your AWS account.
IAM Programmatic access
IAM Programmatic access refers to accessing AWS services programmatically using the AWS APIs or SDKs. This is in contrast to the AWS Management Console which provides a graphical user interface.
When you use programmatic access, you will need to provide AWS credentials to authenticate the requests to the AWS APIs. These credentials can be:
Access key ID and secret access key: These are long-term credentials for IAM users. They allow full access to all AWS services.
Temporary security credentials: These are credentials that are generated for IAM roles. They provide temporary access and are useful for applications or EC2 instances to access AWS.
AWS Security Token Service: STS can also be used to generate temporary security credentials.
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.
Log in to AWS: Go to the AWS website and log in with your AWS account.
Find IAM: Look for "IAM" in the AWS dashboard, it's where you manage users and their permissions.
Create a User: If you don't have a user already, you can make one. This user will use the access keys. Just give the user a name and choose what they can do on AWS.
Generate Access Keys: Click on the user you created, and go to the "Security credentials" section. There, you can make access keys.
Download the Keys: Once you create the keys, you'll see them on your screen. Click to download them. It's a file with important secret codes.
- Click on the create access key.
- Choose the CLI option or as per your requirement.
- Now, create the access key.
- You can see two keys now which are the Access key and the Secret access key Save it.
Task 2: Setup and install AWS CLI and configure your account credentials.
Launch the EC2 instance with the script given below:
#!/bin/bash
sudo apt-get update
sudo apt-get install awscli -y
Run the following command to verify the installation:
aws --version
Configure your AWS CLI Credentials
"Thank you for enjoying my DevOps blog! Your positive response fuels my passion to dive deeper into technology and innovation.
Stay tuned for more captivating DevOps articles, where we'll explore this dynamic field together. Follow me on Hashnode and connect on LinkedIn (https://www.linkedin.com/in/som-shanker-pandey/) for the latest updates and discussions.