AWS CLI, Costs and Next Steps
The AWS CLI
The AWS CLI lets you control AWS by typing commands. Install it, then sign in once:
The web console is great for exploring, but the CLI is faster for repeated tasks, works in scripts, and shows exactly what you did. Developers use both. Commands follow the pattern aws <service> <action>, like aws s3 ls.
Example
aws configure # or: aws configure sso
aws sts get-caller-identity # shows which account you are using
aws ec2 describe-instances --query "Reservations[].Instances[].InstanceId"
aws s3 lsKeeping costs under control
- New accounts get some free usage or credits for a limited time. The details change, so check the AWS Free Tier page before you start.
- Create a budget alert in AWS Budgets, and look at Cost Explorer every week.
- Delete what you are not using: stopped servers still pay for their disks, and unused Elastic IPs and NAT Gateways also cost money.
- Add tags such as
project=shopso you can see what each part costs.
Surprise bills are the most common bad experience for cloud beginners - usually from a forgotten server, a large database, or a NAT Gateway left running after a tutorial. Set a budget alert on day one, tag everything, review costs weekly, and delete practice resources as soon as you finish.
Infrastructure as Code
Instead of clicking around, describe your setup in a file and let AWS build it. Tools: CloudFormation, AWS CDK and Terraform.
What to learn next
- The AWS Certified Cloud Practitioner exam is a good first goal.
- Then Solutions Architect – Associate or Developer – Associate.
- Practise with a small project: a static site on S3 and CloudFront, plus a Lambda contact form.
Key points
- The AWS CLI controls AWS from the terminal.
- Set budget alerts and check Cost Explorer.
- Delete unused resources - many cost money even when idle.
- Infrastructure as Code builds setups from files.
📝 Test yourself
1. Which command shows which AWS account the CLI is using?
2. Which service sends an alert when spending goes over a limit?
3. Fill in the command that sets up the CLI with your details:
aws
