| name | aws-cli |
| description | Use the AWS CLI to manage S3 buckets, Lambda functions, EC2 instances, IAM, DynamoDB, and all AWS services from the terminal. Use this instead of the AWS MCP server. |
AWS CLI
Official CLI for Amazon Web Services. Manage all AWS services from the terminal.
Authentication
aws configure
aws configure --profile staging
aws sts get-caller-identity
aws sso login --profile my-sso
Environment variables: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_DEFAULT_REGION
Common Commands
S3
aws s3 ls
aws s3 ls s3://my-bucket/
aws s3 cp file.txt s3://my-bucket/
aws s3 cp s3://my-bucket/file.txt ./
aws s3 sync ./dist s3://my-bucket/ --delete
aws s3 rm s3://my-bucket/file.txt
aws s3 mb s3://new-bucket
Lambda
aws lambda list-functions --query 'Functions[].FunctionName'
aws lambda invoke --function-name my-func --payload '{}' output.json
aws lambda update-function-code --function-name my-func --zip-file fileb://deploy.zip
aws lambda get-function --function-name my-func
aws logs tail /aws/lambda/my-func --follow
EC2
aws ec2 describe-instances --query 'Reservations[].Instances[].[InstanceId,State.Name,PublicIpAddress]' --output table
aws ec2 start-instances --instance-ids i-xxx
aws ec2 stop-instances --instance-ids i-xxx
IAM
aws iam list-users
aws iam list-roles --query 'Roles[].RoleName'
aws iam get-role --role-name my-role
DynamoDB
aws dynamodb list-tables
aws dynamodb scan --table-name my-table --max-items 10
aws dynamodb put-item --table-name my-table --item '{"id":{"S":"123"}}'
aws dynamodb query --table-name my-table --key-condition-expression "id = :v" --expression-attribute-values '{":v":{"S":"123"}}'
CloudFormation
aws cloudformation list-stacks --stack-status-filter CREATE_COMPLETE
aws cloudformation describe-stacks --stack-name my-stack
Agent Best Practices
- Always use
--output json with --query (JMESPath) for structured output
- Use
--dry-run flag where available before destructive operations
- Use
--profile to target specific accounts
- Use
aws sts get-caller-identity to confirm which account you're operating on
- Prefer
aws s3 (high-level) over aws s3api (low-level) for common operations
- Use
--no-paginate or --max-items to control output size
Example Workflows
Deploy static site to S3
aws s3 sync ./build s3://my-site-bucket/ --delete
aws cloudfront create-invalidation --distribution-id E1234 --paths "/*"
Check Lambda function status
aws lambda get-function --function-name my-func --query 'Configuration.{State:State,Runtime:Runtime,Memory:MemorySize}' --output table