AWS for Developers: Account Setup, AWS CLI v2, Profiles, SSO and the SDK Credential Chain

AWS Developer Associate 40 min min read Updated: Nov 17, 2026 Beginner
AWS for Developers: Account Setup, AWS CLI v2, Profiles, SSO and the SDK Credential Chain
Beginner Topic 1 of 3

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-1 so calls go to the right place
Never use the root user for daily work. Enable MFA on root, create an admin identity, and lock root away. Never put access keys in code or Git.

Install and Check the CLI

bash # Linux curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o awscliv2.zip unzip awscliv2.zip && sudo ./aws/install aws --version # macOS: brew install awscli Windows: use the MSI installer

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.

ini # ~/.aws/config [default] region = ap-south-1 output = json [profile dev] region = ap-south-1 sso_session = mycompany sso_account_id = 111111111111 sso_role_name = DeveloperAccess [profile prod-readonly] role_arn = arn:aws:iam::222222222222:role/ReadOnly source_profile = dev region = ap-south-1 [sso-session mycompany] sso_start_url = https://mycompany.awsapps.com/start sso_region = ap-south-1 sso_registration_scopes = sso:account:access
bash aws configure sso # guided SSO setup aws sso login --profile dev # opens the browser, gets temporary credentials aws sts get-caller-identity --profile dev # who am I? export AWS_PROFILE=dev # use this profile for the shell session aws s3 ls aws configure list # show where each setting comes from
Result

{ "UserId": "AROAXXXX:ravi", "Account": "111111111111", "Arn": "arn:aws:sts::111111111111:assumed-role/AWSReservedSSO_DeveloperAccess_abc/ravi" }

Why SSO? Identity Center gives short-lived credentials that expire, so a leaked laptop file is far less dangerous than a permanent access key.

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.

OrderSourceTypical use
1Explicit values in code (avoid)Quick tests only
2Environment variables: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKENCI/CD, containers
3Shared config and credentials files and SSO profile (AWS_PROFILE)Developer laptops
4Web identity token (AWS_WEB_IDENTITY_TOKEN_FILE)EKS service accounts, GitHub OIDC
5Container credentials (ECS task role)ECS and Fargate
6EC2 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

python import boto3 session = boto3.Session(profile_name="dev", region_name="ap-south-1") s3 = session.client("s3") for b in s3.list_buckets()["Buckets"]: print(b["Name"]) # resource-style helper for DynamoDB table = session.resource("dynamodb").Table("Orders") print(table.table_status)
javascript import { S3Client, ListBucketsCommand } from "@aws-sdk/client-s3"; const s3 = new S3Client({ region: "ap-south-1" }); // credentials come from the chain const out = await s3.send(new ListBucketsCommand({})); console.log(out.Buckets.map(b => b.Name));
  • 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

FeatureExample
Filter output with JMESPathaws ec2 describe-instances --query 'Reservations[].Instances[].[InstanceId,State.Name]' --output table
Output formats--output json, table, text, yaml
Dry runaws ec2 run-instances ... --dry-run checks permission without creating
Generate request skeletonaws dynamodb put-item --generate-cli-skeleton
PaginationCLI pages automatically. Use --max-items or --page-size to control it
Debug--debug shows the signed request and the credential source
Wait for stateaws ec2 wait instance-running --instance-ids i-123

Troubleshooting Setup

ErrorLikely cause
Unable to locate credentialsNo profile or role found. Run aws configure list, set AWS_PROFILE
ExpiredTokenSSO or role session ended. Log in again
AccessDenied / UnauthorizedOperationIdentity lacks permission or an SCP or boundary blocks it
Could not connect to the endpoint URLWrong Region or no network or proxy
Resource not found but it existsYou are in a different Region or account. Check get-caller-identity

Practice Tasks

  1. Create a billing budget and email alert
  2. Install CLI v2 and configure an SSO profile
  3. Run aws sts get-caller-identity and read each field
  4. List your S3 buckets with boto3 and with the JavaScript SDK
  5. Run aws configure list with and without AWS_PROFILE set 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.

Quick Summary: setup; CLI install; profiles + SSO; credential chain; boto3/JS SDK; CloudShell; CLI features; troubleshooting.

Get Newsletter

Subscibe to our newsletter and we will notify you about the newest updates on Edugators