AWS 命令行接口
aws 是 AWS CLI 的入口,覆盖 S3、EC2、IAM、CloudWatch 等几乎所有 AWS 服务。它按 aws <service> <operation> 组织命令,支持 profile、区域和 JMESPath 输出过滤。
aws configure
aws configure --profile prod
aws sso login --profile prod
aws sts get-caller-identity
aws s3 ls
aws s3 sync ./dist s3://my-bucket/dist --delete
aws s3api list-buckets --query 'Buckets[].Name' --output table
aws ec2 describe-instances \
--filters "Name=instance-state-name,Values=running" \
--query 'Reservations[].Instances[].InstanceId' \
--output text
aws logs tail /aws/lambda/my-fn --follow
aws iam list-users --output table
aws --profile prod --region ap-southeast-1 s3 ls
aws configure list。aws sso login,不要急着重配密钥。~/.aws/credentials 和 ~/.aws/config;不要提交到仓库或打进镜像。--query 使用 JMESPath,shell 引号要包好;写错时输出为空而不是报错。s3 sync --delete 会删除目标端多余文件;先 --dryrun 确认范围。s3://bucket/key 和本地路径;漏斜杠会改变同步语义。--no-paginate 或循环处理 NextToken。gcloud — Google Cloud CLIaz — Azure CLIterraform — 声明式管理云资源