aws(1)
AWS Command Line Interface for managing Amazon Web Services resources from the terminal.
Synopsis
aws [OPTIONS] <service> [<command>] [<subcommand>] [PARAMETERS]Description
The AWS CLI is a unified tool for interacting with AWS services. It allows you to control multiple AWS services from the command line and automate them through scripts.
Commands are structured as aws service command subcommand, for example aws ec2 describe-instances or aws s3 cp file.txt s3://bucket/. Each service has its own set of operations and parameters.
Configuration is stored in ~/.aws/credentials and ~/.aws/config. You can use multiple named profiles for different AWS accounts or roles.
Common options
| Flag | What it does |
|---|---|
--profile PROFILE | Use a specific named profile from credentials and config files |
--region REGION | Set AWS region (e.g., us-east-1, eu-west-1) |
--output FORMAT | Output format: json (default), text, table, or yaml |
--query QUERY | Filter output using JMESPath syntax |
--endpoint-url URL | Override default endpoint URL (useful for S3 or LocalStack) |
--no-sign-request | Do not sign the request (for public S3 buckets) |
--debug | Enable debug logging for troubleshooting |
--version | Display AWS CLI version |
Examples
Copy a local file to an S3 bucket
aws s3 cp myfile.txt s3://my-bucket/List all EC2 instances in a region with table formatting
aws ec2 describe-instances --region us-east-1 --output tableRecursively list all objects in an S3 bucket
aws s3 ls s3://my-bucket/ --recursiveList all IAM usernames, extracting only the username field
aws iam list-users --query 'Users[*].UserName' --output textScan a DynamoDB table using the 'production' AWS profile
aws dynamodb scan --table-name my-table --profile productionInvoke a Lambda function synchronously and save response to file
aws lambda invoke --function-name my-function /tmp/output.jsonAssume an IAM role and obtain temporary credentials
aws sts assume-role --role-arn arn:aws:iam::123456789:role/MyRole --role-session-name session1Interactively configure credentials and default settings for a named profile
aws configure --profile myprofile