In this hands-on lab, you will generate access keys for an IAM user, install the AWS CLI, and configure it using the generated access keys.
- A valid AWS account (free-trial or pay-as-you-go subscription).
- Access to the AWS Management Console.
- Administrator privileges to create IAM users and access keys.
- Open a web browser and navigate to AWS Console.
- Enter your AWS credentials and log in.
- In the AWS Console, search for IAM and select the service.
- In the left pane, click on Users.
- Click Create User.
- Enter the following details:
- User name:
user1
- Enable AWS Management Console access (check the box).
- Set a custom password or generate a new one.
- User name:
- Click Next, keeping all default settings.
- Click Create User.
- Download the .csv file with login credentials.
- In the IAM service, select the newly created user (
user1
). - Navigate to the Security Credentials tab.
- Scroll down to Access Keys and click Create Access Key.
- Choose Command Line Interface (CLI) as the use case and click Next.
- Click Create Access Key.
- Download the .csv file containing the Access Key ID and Secret Access Key.
- Open a terminal or command prompt and run:
aws --version
- If AWS CLI is installed, the version number will be displayed.
Windows:
- Download the AWS CLI installer from AWS Official Site.
- Run the installer and follow the on-screen instructions.
- Verify installation with:
aws --version
macOS:
- Install AWS CLI using Homebrew:
brew install awscli
- Verify installation:
aws --version
Linux:
- Install AWS CLI using the package manager for your distribution:
sudo apt install awscli # Debian/Ubuntu sudo yum install awscli # RHEL/CentOS
- Verify installation:
aws --version
- Open a terminal or command prompt.
- Run the following command:
aws configure
- Enter the credentials downloaded earlier:
- Access Key ID: (Paste from
.csv
file) - Secret Access Key: (Paste from
.csv
file) - Default region: (e.g.,
us-east-1
oreu-west-1
) - Default output format: (
json
,table
, ortext
)
- Access Key ID: (Paste from
- Run the following command to list all S3 buckets:
aws s3 ls
- If correctly configured, the command should return a list of available S3 buckets (or an empty response if none exist).
To complete this lab:
- Take screenshots of:
- IAM User creation.
- Access Key generation.
- AWS CLI installation.
- AWS CLI configuration process.
- Successful execution of
aws s3 ls
.
- Paste the screenshots into a Google Doc.
- Upload the document to Google Drive.
- To submit the lab, paste the Google Drive link in the submission field in the Student Portal.
This lab provides practical experience in configuring AWS CLI and securely managing IAM credentials, ensuring controlled access to AWS services.