AWS Cloud Fundamentals
Understand the core AWS services — EC2, S3, Lambda, and more — and how to use them effectively.
CloudBeginner18 min read
AI Summary
Quick context for AWS Cloud Fundamentals
AWS Cloud Fundamentals is a beginner guide in Cloud. Understand the core AWS services — EC2, S3, Lambda, and more — and how to use them effectively.. Key topics: aws, cloud, ec2, lambda.
## What Is Cloud Computing?
Cloud computing delivers computing resources — servers, storage, databases, networking, and software — over the internet on a pay-as-you-go model. Instead of buying and maintaining physical hardware, you rent what you need and scale up or down as demand changes.
AWS (Amazon Web Services) is the largest cloud provider, offering over 200 services. This guide covers the foundational services you will use most often.
## Setting Up Your AWS Account
```bash
# Install the AWS CLI
pip install awscli
# Configure credentials
aws configure
# Enter your Access Key ID, Secret Access Key, region, and output format
# Verify setup
aws sts get-caller-identity
```
Store credentials securely using environment variables or the `~/.aws/credentials` file. Never commit secrets to **GitHub**.
## EC2: Virtual Servers
EC2 (Elastic Compute Cloud) provides resizable virtual machines in the cloud.
### Launching an Instance
```bash
# Launch a t3.micro instance (free tier eligible)
aws ec2 run-instances \
--image-id ami-0c55b159cbfafe1f0 \
--instance-type t3.micro \
--key-name my-key-pair \
--security-group-ids sg-0123456789abcdef0 \
--subnet-id subnet-0123456789abcdef0 \
--tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=MyServer}]'
```
### Managing Instances
```bash
# List running instances
aws ec2 describe-instances --filters "Name=instance-state-name,Values=running"
# Stop an instance
aws ec2 stop-instances --instance-ids i-0123456789abcdef0
# Terminate an instance
aws ec2 terminate-instances --instance-ids i-0123456789abcdef0
```
### Key Concepts
- **AMI**: Amazon Machine Image — the OS template for your instance.
- **Instance Type**: Determines CPU, memory, and network capacity.
- **Security Group**: Virtual firewall controlling inbound and outbound traffic.
- **Key Pair**: SSH credentials for accessing Linux instances.
## S3: Object Storage
S3 (Simple Storage Service) stores any amount of data with high durability (99.999999999%).
### Creating and Using Buckets
```bash
# Create a bucket
aws s3 mb s3://my-unique-bucket-name-2026
# Upload a file
aws s3 cp ./local-file.txt s3://my-unique-bucket-name-2026/documents/file.txt
# Upload an entire directory
aws s3 cp ./build/ s3://my-unique-bucket-name-2026/assets/ --recursive
# List bucket contents
aws s3 ls s3://my-unique-bucket-name-2026/
# Download a file
aws s3 cp s3://my-unique-bucket-name-2026/documents/file.txt ./downloaded-file.txt
```
### Static Website Hosting
```bash
# Enable website hosting
aws s3 website s3://my-unique-bucket-name-2026 \
--index-document index.html \
--error-document error.html
# Set a bucket policy for public read access
aws s3api put-bucket-policy \
--bucket my-unique-bucket-name-2026 \
--policy file://policy.json
```
This pattern is useful for hosting static sites deployed from **Vercel** or CI/CD pipelines.
## Lambda: Serverless Functions
Lambda runs code without provisioning or managing servers. You pay only for the compute time consumed.
### Your First Lambda Function
```javascript
// index.mjs
export const handler = async (event) => {
const name = event.queryStringParameters?.name || "World";
return {
statusCode: 200,
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
message: `Hello, ${name}!`,
timestamp: new Date().toISOString(),
}),
};
};
```
```bash
# Package and deploy
zip function.zip index.mjs
aws lambda create-function \
--function-name hello-world \
--runtime nodejs20.x \
--role arn:aws:iam::123456789012:role/lambda-role \
--handler index.handler \
--zip-file fileb://function.zip
# Test the function
aws lambda invoke --function-name hello-world \
--payload '{"queryStringParameters":{"name":"DevAtlas"}}' \
output.json
cat output.json
```
### Lambda with API Gateway
Lambda functions are often exposed via API Gateway for HTTP access:
```yaml
# SAM template snippet
Resources:
HelloFunction:
Type: AWS::Serverless::Function
Properties:
Runtime: nodejs20.x
Handler: index.handler
Events:
Hello:
Type: Api
Properties:
Path: /hello
Method: get
```
## IAM: Identity and Access Management
IAM controls who can access what. Follow the principle of least privilege.
```bash
# Create a read-only user
aws iam create-user --user-name readonly-user
aws iam create-access-key --user-name readonly-user
# Attach a managed policy
aws iam attach-user-policy \
--user-name readonly-user \
--policy-arn arn:aws:iam::aws:policy/ReadOnlyAccess
```
### Best Practices
- Never use the root account for daily operations.
- Create IAM users and groups for team members.
- Use roles for applications and services, not long-lived credentials.
- Enable MFA on all privileged accounts.
## RDS: Managed Databases
RDS (Relational Database Service) manages PostgreSQL, MySQL, and other databases with automated backups and scaling.
```bash
# Create a PostgreSQL instance
aws rds create-db-instance \
--db-instance-identifier mydb \
--db-instance-class db.t3.micro \
--engine postgres \
--master-username admin \
--master-user-password YourSecurePassword123 \
--allocated-storage 20 \
--backup-retention-period 7 \
--multi-az
```
## Cost Optimization
- Use **EC2 Spot Instances** for fault-tolerant workloads (up to 90% savings).
- Enable **S3 Intelligent-Tiering** for data with unpredictable access patterns.
- Set up **AWS Budgets** and **Cost Explorer** alerts to avoid surprises.
- Use the **Free Tier** for learning and prototyping.
## Architecting a Simple Web Application
A common architecture for beginners combines these services:
```
User → Route 53 (DNS) → CloudFront (CDN) → S3 (Static Frontend)
↘ API Gateway → Lambda (API) → DynamoDB (Database)
```
This serverless pattern eliminates server management entirely, scales automatically, and minimizes cost at low traffic levels.
## Next Steps
Once you are comfortable with these core services, explore **DynamoDB** for serverless NoSQL, **SQS** and **SNS** for messaging, **ECS** and **EKS** for container orchestration, and **CloudFormation** for infrastructure as code. Consider deploying your applications with **Vercel** or a CI/CD pipeline hosted on **GitHub** Actions.
Continue with related content
Suggested next reads and tools from the knowledge graph.