awscli
There are four primary ways to interact with AWS: the web console, the command line, IaC tools, and SDKs. Compared to the web console, the command line interface is typically more efficient and straightforward for many tasks.
awscli is the official command line interface for AWS. It is written in Python and can be installed via pip or Homebrew:
$ brew install awscli
Setting Up AWS CLI
After installation, configure your AWS credentials:
$ aws configure
You'll need to provide your Access Key ID and Secret Access Key, which can be obtained from the AWS Management Console. To do this, navigate to IAM (Identity and Access Management), create a new user, and during the process, create a user group and assign necessary permissions, such as "S3FullAccess" and "SNSFullAccess."
Once the user is created, generate an access key for that user to complete the CLI configuration.
Verify Configuration
To confirm that your setup is correct, run:
$ aws sts get-caller-identity
You should see an output similar to the following:
{
"UserId": "***",
"Account": "***",
"Arn": "arn:aws:iam::<account>:user/<name>"
}
Here, "Arn" stands for Amazon Resource Name, which uniquely identifies AWS resources.