Amazon Web Services (AWS) is the leading cloud platform. This guide covers the essentials: EC2, S3, IAM, and VPC. You'll be deploying to the cloud in no time.
What is AWS?
AWS provides on-demand cloud computing resources. Pay for what you use. No upfront hardware costs. Global infrastructure with data centers worldwide.
Setting Up AWS CLI
The AWS Command Line Interface lets you manage AWS services from your terminal.
sudo apt update
sudo apt install awscli
aws --version
Configuring AWS Access
Create an IAM user and configure your credentials:
aws configure
AWS Access Key ID [None]: your-access-key
AWS Secret Access Key [None]: your-secret-key
Default region name [None]: us-east-1
Default output format [None]: json
EC2 - Elastic Compute Cloud
EC2 provides virtual servers in the cloud. Launch, manage, and scale instances programmatically.
Launch an Instance
aws ec2 run-instances \
--image-id ami-0c55b159cbfafe1f0 \
--instance-type t2.micro \
--key-name my-key-pair \
--security-group-ids sg-12345678
List Instances
aws ec2 describe-instances
Stop an Instance
aws ec2 stop-instances --instance-id i-1234567890abcdef0
Terminate an Instance
aws ec2 terminate-instances --instance-id i-1234567890abcdef0
S3 - Simple Storage Service
S3 provides object storage. Store files, backups, and static websites.
Create a Bucket
aws s3 mb s3://my-unique-bucket-name
Upload a File
aws s3 cp myfile.txt s3://my-bucket/
List Bucket Contents
aws s3 ls s3://my-bucket/
Download a File
aws s3 cp s3://my-bucket/myfile.txt ./
Delete a Bucket
aws s3 rb s3://my-bucket --force
IAM - Identity and Access Management
IAM manages who can access your AWS resources. Always follow the principle of least privilege.
Create an IAM User
aws iam create-user --user-name developer
Create Access Keys
aws iam create-access-key --user-name developer
Attach a Policy
aws iam attach-user-policy \
--user-name developer \
--policy-arn arn:aws:iam::aws:policy/AmazonS3ReadOnlyAccess
VPC - Virtual Private Cloud
VPC lets you launch AWS resources in an isolated virtual network.
Create a VPC
aws ec2 create-vpc --cidr-block 10.0.0.0/16
Create a Subnet
aws ec2 create-subnet \
--vpc-id vpc-12345678 \
--cidr-block 10.0.1.0/24 \
--availability-zone us-east-1a
Essential Services Overview
- RDS - Managed relational databases (MySQL, PostgreSQL, Oracle)
- Lambda - Serverless functions
- CloudFront - Content delivery network
- Route 53 - DNS service
- ELB - Load balancers
Cleaning Up
Always terminate unused instances and delete unused resources to avoid charges:
aws ec2 terminate-instances --instance-id i-1234567890abcdef0
aws s3 rb s3://my-bucket --force
You're now ready to start deploying to AWS!
Learn More
- AWS Guide - Interactive lessons
- Terraform Blog - Infrastructure as code
- CI/CD Blog - Deploy automatically
// Comments
Leave a Comment