Cheat sheet
54 commandes essentielles, prêtes à copier.
Identity
aws sts get-caller-identityConfirm the active account and principal before making changes.aws configure listInspect credential source, profile, and configured Region.aws iam simulate-principal-policy --policy-source-arn ARN --action-names ACTIONSimulate selected IAM actions for a principal.aws accessanalyzer validate-policy --policy-document file://policy.json --policy-type IDENTITY_POLICYValidate IAM policy syntax and findings.EC2
aws ec2 describe-instances --query 'Reservations[].Instances[]'List instances with filtered output.aws ec2 run-instances --image-id AMI --instance-type TYPE --subnet-id SUBNETLaunch EC2 capacity.aws ec2 describe-instance-types --instance-types TYPEInspect CPU, memory, network, storage, and EFA support.aws ec2 create-placement-group --group-name NAME --strategy clusterCreate a cluster placement group for compatible tightly coupled instances.aws ec2 describe-spot-price-history --instance-types TYPE --product-descriptions 'Linux/UNIX'Inspect recent Spot price history; capacity availability remains separate.VPC
aws ec2 create-vpc --cidr-block 10.40.0.0/16Create a VPC.aws ec2 create-subnet --vpc-id VPC --cidr-block CIDR --availability-zone AZCreate a zonal subnet.aws ec2 create-route-table --vpc-id VPCCreate a route table.aws ec2 create-route --route-table-id RT --destination-cidr-block 0.0.0.0/0 --gateway-id IGWAdd an IPv4 default route through an internet gateway.aws ec2 describe-route-tables --filters Name=vpc-id,Values=VPCInspect route tables and associations.aws ec2 describe-security-groups --group-ids SGInspect stateful network policy.aws ec2 create-vpc-endpoint --vpc-id VPC --service-name SERVICE --vpc-endpoint-type TYPECreate private service access through a VPC endpoint.S3
aws s3 lsList accessible S3 buckets or objects.aws s3 cp SOURCE DESTINATION --recursiveCopy objects or directory trees.aws s3 sync SOURCE DESTINATION --deleteSynchronize object trees; review deletion behavior first.aws s3api put-public-access-block --bucket BUCKET --public-access-block-configuration ...Configure account or bucket public-access blocking.aws s3api put-bucket-versioning --bucket BUCKET --versioning-configuration Status=EnabledEnable object versioning.aws s3api put-bucket-encryption --bucket BUCKET --server-side-encryption-configuration FILEConfigure default server-side encryption.RDS
aws rds describe-db-instancesList managed database instances and topology.aws rds create-db-instance --db-instance-identifier NAME --db-instance-class CLASS --engine ENGINECreate an RDS DB instance; production requires more security and recovery options.DynamoDB
aws dynamodb describe-table --table-name TABLEInspect table keys, status, indexes, and capacity mode.aws dynamodb query --table-name TABLE --key-condition-expression EXPRRun a key-based query.Lambda
aws lambda list-functionsList Lambda functions.aws lambda invoke --function-name NAME --payload JSON response.jsonInvoke a function synchronously for testing.Integration
aws sqs get-queue-attributes --queue-url URL --attribute-names AllInspect queue depth, age-related inputs, policy, and DLQ redrive settings.aws sqs send-message --queue-url URL --message-body BODYSend a queue message.aws events list-rulesList EventBridge rules.Observability
aws cloudwatch describe-alarmsInspect CloudWatch alarm state.aws logs tail LOG_GROUP --followTail CloudWatch Logs from the CLI.aws cloudtrail lookup-events --lookup-attributes AttributeKey=EventName,AttributeValue=ACTIONSearch recent management events by API action.CloudFormation
aws cloudformation validate-template --template-body file://template.yamlValidate basic template structure.aws cloudformation create-change-set --stack-name NAME --template-body file://template.yaml --change-set-name reviewCreate a reviewable proposed stack change.aws cloudformation describe-stack-events --stack-name NAMEInspect resource deployment events and failures.Cost
aws ce get-cost-and-usage --time-period Start=YYYY-MM-DD,End=YYYY-MM-DD --granularity MONTHLY --metrics UnblendedCostQuery Cost Explorer data where enabled and permitted.aws budgets describe-budgets --account-id ACCOUNTList configured budgets.Slurm
sinfo -o '%P %a %l %D %t %N'Show partition and node state.squeue -o '%.18i %.9P %.16j %.8u %.2t %.10M %.6D %R'Show jobs, states, resources, and pending reasons.sbatch job.shSubmit a batch script.srun --nodes=2 --ntasks-per-node=32 ./solverLaunch a parallel job step in an allocation.scontrol show job JOB_IDInspect a job request, allocation, state, and reason.sacct -j JOB_ID --format=JobID,State,Elapsed,AllocCPUS,MaxRSS,ExitCodeReview completed job accounting and resource use.scancel JOB_IDCancel a queued or running job.MPI
mpirun --versionConfirm the MPI implementation and version.fi_info -p efaVerify the libfabric EFA provider is available.Linux
lscpuInspect CPU architecture, sockets, cores, threads, and NUMA layout.numactl --hardwareInspect NUMA nodes and memory distances.nvidia-smiInspect supported NVIDIA GPU devices, utilization, memory, and health.iostat -xz 1Observe block-device utilization, queueing, and latency.df -hT && df -iInspect filesystem capacity and inode usage.sha256sum FILEGenerate a content checksum for reproducibility or transfer validation.