What a Developer Needs on AWS
- An AWS account (use the free tier and set a budget alarm first)
- A non-root identity: an IAM Identity Center user (best) or an IAM user with MFA
- The AWS CLI v2 to run commands and the SDK for your language (boto3 for Python, AWS SDK v3 for JavaScript, SDKs for Java, .NET, Go and more)
- A default Region such as
ap-south-1so calls go to the right place
Install and Check the CLI
Named Profiles
A profile is a named set of settings and credentials stored in ~/.aws/config and ~/.aws/credentials. Use one profile per account or role so you never run a command in the wrong place.
{ "UserId": "AROAXXXX:ravi", "Account": "111111111111", "Arn": "arn:aws:sts::111111111111:assumed-role/AWSReservedSSO_DeveloperAccess_abc/ravi" }
Credential Provider Chain
When your code creates an SDK client without keys, the SDK searches in a fixed order and uses the first credentials it finds. Knowing this order solves most 'works on my laptop, fails on EC2' problems.
| Order | Source | Typical use |
|---|---|---|
| 1 | Explicit values in code (avoid) | Quick tests only |
| 2 | Environment variables: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN | CI/CD, containers |
| 3 | Shared config and credentials files and SSO profile (AWS_PROFILE) | Developer laptops |
| 4 | Web identity token (AWS_WEB_IDENTITY_TOKEN_FILE) | EKS service accounts, GitHub OIDC |
| 5 | Container credentials (ECS task role) | ECS and Fargate |
| 6 | EC2 instance profile through instance metadata (IMDSv2) | EC2 |
Lambda supplies credentials of its execution role through environment variables. Best practice: no keys in code anywhere. Use roles in AWS and SSO or OIDC outside AWS.
Your First SDK Calls
- Create clients once, outside request handlers, and reuse them (important in Lambda)
- Always set the Region (
AWS_REGION, config file, or in code) - The JavaScript SDK v3 is modular: import only the service clients you use
AWS CloudShell
CloudShell is a browser shell inside the console with the CLI, Python, Node and Git already installed, and it uses your console login. It is good for quick checks and needs no local setup. It keeps 1 GB of home storage per Region.
Handy CLI Features
| Feature | Example |
|---|---|
| Filter output with JMESPath | aws ec2 describe-instances --query 'Reservations[].Instances[].[InstanceId,State.Name]' --output table |
| Output formats | --output json, table, text, yaml |
| Dry run | aws ec2 run-instances ... --dry-run checks permission without creating |
| Generate request skeleton | aws dynamodb put-item --generate-cli-skeleton |
| Pagination | CLI pages automatically. Use --max-items or --page-size to control it |
| Debug | --debug shows the signed request and the credential source |
| Wait for state | aws ec2 wait instance-running --instance-ids i-123 |
Troubleshooting Setup
| Error | Likely cause |
|---|---|
Unable to locate credentials | No profile or role found. Run aws configure list, set AWS_PROFILE |
ExpiredToken | SSO or role session ended. Log in again |
AccessDenied / UnauthorizedOperation | Identity lacks permission or an SCP or boundary blocks it |
Could not connect to the endpoint URL | Wrong Region or no network or proxy |
| Resource not found but it exists | You are in a different Region or account. Check get-caller-identity |
Practice Tasks
- Create a billing budget and email alert
- Install CLI v2 and configure an SSO profile
- Run
aws sts get-caller-identityand read each field - List your S3 buckets with boto3 and with the JavaScript SDK
- Run
aws configure listwith and withoutAWS_PROFILEset and explain the difference
Conclusion
Use a non-root identity, prefer SSO and roles over access keys, keep one profile per account, understand the SDK credential provider chain, create clients once with an explicit Region, and use CloudShell for quick work.

