Which CLI habits make automation safe and fast in production?
BeginnerProductionRapid-Fire AWS CLI
Answer
aws ec2 terminate-instances --instance-ids i-0abc123 --dry-run # permission check, no change
aws ec2 wait instance-running --instance-ids i-0abc123 # block until state reached
aws s3api list-objects-v2 --bucket logs-prod --max-items 100 # paginate, do not fetch all
export AWS_RETRY_MODE=adaptive AWS_MAX_ATTEMPTS=10 # back off on throttling
export AWS_PAGER="" # no pager in scripts
aws ec2 describe-instances --region eu-west-1 --output json | jq . # explicit region and format
Always pass --region and --profile explicitly in scripts, prefer --query over grepping text, and use --cli-input-json / --generate-cli-skeleton for complex calls.
More on Rapid-Fire AWS CLI
How do you check which identity and account the CLI is using?BeginnerHow do you log in with Identity Center (SSO) from the CLI?BeginnerHow do you assume a role manually and export the credentials?IntermediateHow do you list running instances with name, ID, type and private IP in a table?BeginnerHow do you find the latest Amazon Linux 2023 AMI without hard-coding an ID?BeginnerHow do you open a shell or port-forward to a private instance without SSH?Beginner