Bytes
Data Science

AWS Cheat Sheet (Amazon Web Services Cheat Sheet)

Last Updated: 27th August, 2024
icon

Arunav Goswami

Data Science Consultant at almaBetter

Discover a detailed AWS cheat sheet covering essential services, CLI commands, certifications, and cloud comparisons ideal for practitioners and developers.

As organizations increasingly move their operations to the cloud, Amazon Web Services (AWS) has emerged as a dominant player in the cloud computing landscape. Understanding AWS, with its extensive range of services, commands, and certifications, can be overwhelming for newcomers and professionals alike. This AWS cheatsheet is designed to provide a consolidated overview of essential AWS concepts, services, commands, and certification-focused knowledge, making it easier to navigate the AWS ecosystem.

All AWS Services Cheat Sheet

AWS offers a vast array of services across different categories such as computing, storage, databases, machine learning, security, and more. Here's a concise summary of key AWS services:

Compute Services

Amazon EC2 (Elastic Compute Cloud): Virtual servers in the cloud, allowing scalable computing capacity.

  • Launch an instance: aws ec2 run-instances --image-id ami-id --instance-type t2.micro --key-name MyKeyPair
  • Stop an instance: aws ec2 stop-instances --instance-ids i-1234567890abcdef0
  • Terminate an instance: aws ec2 terminate-instances --instance-ids i-1234567890abcdef0

AWS Lambda: Run code without provisioning or managing servers, pay only for compute time.

aws lambda create-function --function-name my-function \
  --runtime nodejs14.x --role arn:aws:iam::123456789012:role/service-role/my-role \
  --handler index.handler --zip-file fileb://function.zip
  • Elastic Beanstalk:

Deploy an application: eb init && eb create my-env && eb deploy

Containers

Amazon ECS (Elastic Container Service): Managed container service for Docker containers.

  • Create a cluster: aws ecs create-cluster --cluster-name my-cluster
  • Register a task definition: aws ecs register-task-definition --family my-task --container-definitions file://task-def.json
  • Run a task: aws ecs run-task --cluster my-cluster --task-definition my-task

Amazon EKS (Elastic Kubernetes Service): Managed service to run Kubernetes on AWS.

  • Create a cluster: eksctl create cluster --name my-cluster --region us-east-1 --nodegroup-name linux-nodes --node-type t2.micro --nodes 3

Storage Services

Amazon S3 (Simple Storage Service): Scalable object storage service for data storage and retrieval.

  • Create a bucket: aws s3 mb s3://mybucket
  • Upload a file: aws s3 cp myfile.txt s3://mybucket/myfile.txt
  • Download a file: aws s3 cp s3://mybucket/myfile.txt myfile.txt
  • List bucket contents: aws s3 ls s3://mybucket

Amazon EBS (Elastic Block Store): Block storage for use with Amazon EC2.

  • Create a volume: aws ec2 create-volume --size 10 --region us-east-1 --availability-zone us-east-1a --volume-type gp2
  • Attach volume to instance: aws ec2 attach-volume --volume-id vol-12345678 --instance-id i-1234567890abcdef0 --device /dev/sdf

Amazon Glacier: Low-cost archive storage with long retrieval times.

Database Services

Amazon RDS (Relational Database Service): Managed relational database service supporting multiple database engines like MySQL, PostgreSQL, and SQL Server.

  • Create a MySQL instance: aws rds create-db-instance --db-instance-identifier mydbinstance --allocated-storage 20 --db-instance-class db.t2.micro --engine mysql --master-username admin --master-user-password password
  • Delete a DB instance: aws rds delete-db-instance --db-instance-identifier mydbinstance --skip-final-snapshot

Amazon DynamoDB: Fully managed NoSQL database service.

aws dynamodb create-table --table-name my-table \
  --attribute-definitions AttributeName=Id,AttributeType=S \
  --key-schema AttributeName=Id,KeyType=HASH \
  --provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5
  • Amazon Aurora: High-performance MySQL and PostgreSQL-compatible database service.

Networking & Content Delivery

  • Amazon VPC (Virtual Private Cloud): Provision logically isolated sections of the AWS cloud for virtual networks.
    • 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
    • Create an Internet Gateway: aws ec2 create-internet-gateway
    • Attach Internet Gateway to VPC: aws ec2 attach-internet-gateway --vpc-id vpc-12345678 --internet-gateway-id igw-12345678
  • Amazon Route 53: Scalable DNS and domain name registration service.
  • Amazon CloudFront: Content delivery network (CDN) service to deliver content with low latency.

Security Services

  • AWS IAM (Identity and Access Management): Securely manage access to AWS services and resources.
  • Create a new user: aws iam create-user --user-name new_user
  • Create a policy:
aws iam create-policy --policy-name my-policy --policy-document '{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": "s3:*",
      "Resource": "*"
    }
  ]
}'
  • Attach policy to user: aws iam attach-user-policy --user-name new_user --policy-arn arn:aws:iam::aws:policy/my-policy
  • AWS KMS (Key Management Service): Managed service for creating and controlling encryption keys.
  • AWS WAF (Web Application Firewall): Protect web applications from common web exploits.

Monitoring & Management

  • CloudWatch
  • Create an alarm:
aws cloudwatch put-metric-alarm --alarm-name CPUAlarm \
  --metric-name CPUUtilization --namespace AWS/EC2 \
  --statistic Average --period 300 --threshold 70 \
  --comparison-operator GreaterThanThreshold \
  --dimensions Name=InstanceId,Value=i-1234567890abcdef0 \
  --evaluation-periods 2 --alarm-actions arn:aws:sns:us-east-1:123456789012:my-sns-topic
  • CloudFormation
    • Deploy a stack: aws cloudformation create-stack --stack-name my-stack --template-body file://template.yaml
    • Delete a stack: aws cloudformation delete-stack --stack-name my-stack

AWS Certification Cheat Sheets

AWS offers various certifications to validate expertise in cloud-related roles. Here's a brief guide to some of the key certifications and what candidates need to know:

AWS Cloud Practitioner Cheat Sheet

  • Target Audience: Beginners and non-technical roles.
  • Focus Areas: AWS basics, core services, pricing models, support plans, and fundamental cloud concepts.
  • Key Points:
    • Understanding of AWS global infrastructure.
    • Basic concepts of cloud security and compliance.
    • Overview of AWS services like EC2, S3, RDS, and more.

AWS Solution Architect Associate Cheat Sheet

  • Target Audience: Individuals responsible for designing distributed systems on AWS.
  • Focus Areas: Designing scalable, cost-effective, and secure architectures.
  • Key Points:
    • Knowledge of VPC, EC2, S3, RDS, and Route 53.
    • Designing multi-tier architectures.
    • High availability, fault tolerance, and disaster recovery strategies.

AWS Developer Associate Cheat Sheet

  • Target Audience: Software developers with knowledge of AWS services.
  • Focus Areas: Developing and maintaining applications on AWS.
  • Key Points:
    • Proficiency in AWS SDKs, CLI, and developer tools.
    • Integration of AWS services with applications.
    • Monitoring and debugging applications using AWS tools.

AWS Certified Security - Specialty Cheat Sheet

  • Target Audience: Professionals focusing on AWS security.
  • Focus Areas: Advanced security concepts and services within AWS.
  • Key Points:
    • In-depth understanding of IAM, KMS, and security best practices.
    • Configuring security monitoring and logging using CloudTrail and CloudWatch.
    • Data encryption strategies in AWS.

AWS CLI Commands Cheat Sheet

The AWS CLI(Command Line Interface) is a powerful tool for managing AWS services from the command line, automating tasks, and interacting with various AWS APIs. Here are some key commands:

General Commands

  • aws configure: Configure the AWS CLI with access keys, default region, and output format.
  • aws help: Display help information for AWS CLI commands.

AWS S3 CLI Commands Cheat Sheet

  • aws s3 ls: List S3 buckets or contents within a bucket.
  • aws s3 cp: Copy files to and from S3 buckets.
  • aws s3 sync: Synchronize a directory with an S3 bucket.

EC2 CLI Commands Cheat Sheet

  • aws ec2 describe-instances: Retrieve information about EC2 instances.
  • aws ec2 start-instances: Start stopped EC2 instances.
  • aws ec2 stop-instances: Stop running EC2 instances.

IAM AWS CLI Cheat Sheet

  • aws iam create-user: Create a new IAM user.
  • aws iam list-users: List all IAM users in the account.
  • aws iam attach-user-policy: Attach a managed policy to an IAM user.

AWS vs Azure vs Google Cloud Cheat Sheet

When considering cloud providers, AWS, Azure, and Google Cloud are the primary players. Each has its strengths and weaknesses depending on the specific use case. Here's a brief comparison:

AWS

  • Strengths:
    • Market leader with the broadest range of services.
    • Strong developer community and extensive documentation.
  • Weaknesses:
    • Can be complex for beginners.
    • Pricing can be higher compared to other providers.

Azure

  • Strengths:
    • Seamless integration with Microsoft products.
    • Strong support for hybrid cloud and enterprise applications.
  • Weaknesses:
    • Slightly behind AWS in service variety.
    • Learning curve for non-Microsoft users.

Google Cloud

  • Strengths:
    • Superior performance in data analytics and machine learning.
    • Competitive pricing and strong Kubernetes support.
  • Weaknesses:
    • Fewer services compared to AWS and Azure.
    • Smaller market share and community.

AWS Security Services Cheat Sheet

Security is paramount in cloud computing, and AWS provides a wide range of services to help secure cloud environments:

  • AWS KMS(Key Management Service): Manages encryption keys for secure data storage and transmission.
    • Create a key: aws kms create-key
    • Encrypt a file:
aws kms encrypt --key-id alias/my-key --plaintext fileb://myfile.txt --output text --query CiphertextBlob | base64 --decode > myfile.encrypted
  • ACM (AWS Certificate Manager):  Manage and deploy SSL/TLS certificates.
    • Request a certificate: aws acm request-certificate --domain-name example.com --validation-method DNS
  • AWS Shield: Managed DDoS protection service.
  • AWS WAF: Protects applications from common web exploits.
  • AWS GuardDuty: Threat detection service to monitor malicious activity.
  • AWS Inspector: Automated security assessment service to check for vulnerabilities.

Conclusion

This AWS cheat sheet provides a concise overview of essential AWS services, commands, and certification-related knowledge. Whether you're preparing for an AWS certification, comparing cloud providers, or managing AWS resources via the CLI, these condensed notes offer a valuable reference. Mastering AWS requires time and practice, but having a quick reference guide can significantly ease the learning curve and enhance productivity. With AWS's constantly evolving landscape, staying updated with the latest services and best practices is crucial for cloud professionals.

  • Official Address
  • 4th floor, 133/2, Janardhan Towers, Residency Road, Bengaluru, Karnataka, 560025
  • Communication Address
  • Follow Us
  • facebookinstagramlinkedintwitteryoutubetelegram

© 2024 AlmaBetter