AWS โ Quick Start & Common Commands¶
This page gives a practical quick start for developers and DevOps engineers using AWS: account tips, CLI setup, and common resource commands.
Account & security tips¶
- Use an organizational account (AWS Organizations) for multiple accounts and billing separation.
- Enable MFA for root and important IAM users.
- Create least-privilege IAM roles and use role-assumption for automation.
- Tag resources with
Owner,Environment, andProjectfor cost allocation.
AWS CLI setup¶
Install the AWS CLI and configure credentials:
python -m pip install --user awscli
aws configure
# Provide Access Key ID, Secret Access Key, region (ap-south-1), and output (json)
Use named profiles for multiple accounts:
aws configure --profile sandbox
aws s3 ls --profile sandbox
Common CLI examples¶
- Create an S3 bucket:
aws s3 mb s3://my-bucket-name --region ap-south-1 - Upload a file:
aws s3 cp ./artifact.zip s3://my-bucket-name/ - Launch a small EC2 instance (example using Amazon Linux 2):
aws ec2 run-instances --image-id ami-0abcdef1234567890 --count 1 --instance-type t3.micro --key-name MyKeyPair --security-group-ids sg-01234567 --subnet-id subnet-01234567 - Describe instances:
aws ec2 describe-instances
IAM best practices¶
- Use IAM roles for EC2/containers instead of long-lived credentials.
- Grant least privilege and use permission boundaries for sensitive roles.
- Rotate service credentials and use AWS Secrets Manager for secrets.
Cost & governance¶
- Enable Cost Explorer, set budgets and alerts.
- Use reserved instances or savings plans for stable workloads.
- Implement lifecycle policies for S3 to move older objects to cheaper storage.
If you'd like, I can add runnable examples (CloudFormation/Terraform snippets) or a short walkthrough: "Create an EC2 + S3 static website" for the projects page.