Difference between revisions of "AWS Cloud Essentials"

From Bitnami MediaWiki
Jump to navigation Jump to search
Line 150: Line 150:
 
* Multiple copies reside across locations (AZs)
 
* Multiple copies reside across locations (AZs)
  
−
EBS vs. S3
+
;EBS vs. S3
 
* S3: complete objects or only occasional changes
 
* S3: complete objects or only occasional changes
 
** Every object has a URL; S3 comes web-enabled; access rights included
 
** Every object has a URL; S3 comes web-enabled; access rights included

Revision as of 21:46, 12 March 2021

Module 1: Intro to AWS

  • Cloud computing is the on-demand delivery of IT resources over the internet with pay-as-you-go pricing
  • The undifferentiated heavy lifting of IT: installs, backups, etc that have nothing to do w/ core business
  • 3 types of cloud deployment
  1. Cloud-based: servers, databases, networking all live in the cloud
  2. On-premises: aka private cloud. Resources deployed locally using virtualization and resource management tools, which increase resource utilization
  3. Hybrid deployment: cloud-based resources are connected to on-premises infrastructure. Good for legacy apps, govt regulations
  • Six reasons to use the cloud
  1. Trade upfront for variable costs
  2. Eliminate data center costs
  3. Stop guessing capacity
  4. Massive economies of scale (lower variable cost)
  5. Increase speed and agility
  6. Go global in minutes


Module 2: Compute in the Cloud

  • Spinning up an instance of EC2 instigates a hypervisor to manage VMs using multitenancy. Guarantees security.
  • Vertical scaling is the expansion in CPU/RAM that happens on the fly
  • Server acquisition cheaper under the Compute-as-a-Service model
  • Normal process: 1) purchase hardware, 2) wait for delivery, 3) install in data center, 4) configure
  • AWS process: 1) provision/launch EC2 in mins, 2) stop using it, 3) PAYGO, 4) pay only for necessary server capacity (no "dark fiber" issue)

EC2

  • Different instances for different use cases
  1. general purpose: application servers; gaming servers; backend servers; small/medium databases
  2. compute optimized: high-performance web servers, compute-intensive applications servers, and dedicated gaming servers
  3. memory optimized: a workload that requires large amounts of data to be preloaded before running an application; high-performance databases
  4. accelerated computing: floating-point number calculations, graphics processing, and data pattern matching
  5. storage optimized: distributed file systems, data warehousing applications, and high-frequency online transaction processing (OLTP) systems
  • Input/output Operations Per Second (IOPS) measures performance of storage device
Pricing
  1. On-demand: PAYGO, no contract
  2. Savings Plan: 72% off USD/hr for fixed usage contract over 1/3 yr term
  3. Reserved instances: 75% off On-Demand; 1/3yr term
  4. Spot instances: 90% off but revokable by AMZN w/ 2mins notice
  5. Dedicated Hosts: non-multitenancy dedicated machines; usually for compliance
Scaling EC2
  • EC2 Auto Scaling: automatically add/drop EC2 instances based on demand (dynamic, predictive or both)
  • Scale up = increase depth (add more compute power), scale out = increase breadth (add machines)
  • Parameters: Minimum, Desired, Scale as Needed, Maximum EC2 instances
Elastic Load Balancing
  • Which EC2 instance handles a request is determined by a load balancer
  • ELB = first "major managed services" to be discussed herein
  • Regional rather than on individual EC2 instances guarantees high availability
  • Automatically scales, with no additional cost
  • Front-end independent
Messaging and Queuing
  • SNS and SQS facilitate application integration
  • Tightly coupled applications (A talks directly to B and depends on its I/O) are subject to faults
  • "Loosely coupled" applications use a message queue as a buffer between processes A and B so if one fails, the other doesn't (necessarily)
  • SQS (Simple Queue Service): send/store/receive messages between software components at any volume, with no faults; where messages are placed until processed
  • SNS (Simple Notification Service): uses pub/sub (publish/subscribe) model to send messages to end-users/subscribers. Compatible w/ push/SMS/email
  • Fault tolerance achieved through microservices architecture (i.e., loose coupling)

Additional Compute Services

  • Serverless: your code runs on servers, but you do not need to provision or manage these servers.
  • Even EC2 requires management oversight to update server software, provisioning estimates, etc.
  • AWS Lambda is a serverless compute option, maintained by AWS. Designed to be run by triggers, processes < 15 mins long (not deep learning). Pay only if triggered
  • Elastic Container Service (ECS) provides portability but also access to a server. Runs in a Docker container
  • ECS Docker containers run on clusters of EC2 machines
  • Elastic Kubernetes Service (EKS): performs same functions as ECS using different software
  • AWS Fargate: serverless platform for ECS or EKS; manages server infrastructure for you


Module 3: AWS Global Infrastructure

  • Regional data sovereignty
  1. Compliance - must your data reside in a certain jurisdiction?
  2. Proximity - speed of light still dictates speed
  3. Feature availability - some new services require physical hardware not everywhere available
  4. Pricing - costs 50% more to run in Brazil than Oregon
  • A Region is a geographically isolated area, consisting of two or more Availability Zones
  • Availability Zones: each Region comprises multiple data centers. Each center or group of centers is an Availability Zone(AZ). Allow running across physical venues while keeping applications logically unfied
  • AWS recommends (as "best practice") using redundantly deployed infrastructure in two different AZs- must your data reside in a certain jurisdiction?

Edge Locations

  • An edge location is a site that Amazon CloudFront (AWS's CDN) uses to store cached copies of your content closer to your customers for faster delivery
  • Edge locations also run a DNS, Amazon Route 53, directing customers to lowest latency venue
  • AWS Outposts is fully operational mini Region, inside your building (100% O&O by AWS)

Provisioning AWS Services

  1. AWS Management Console: web-based interface
  2. AWS CLI: Automate provisioning through scripts
  3. AWS SDKs: programming language-specific APIs
  • Managed tools: Elastic Beanstalk takes provided parameters and builds out a given configuration
  • CloudFormation facilitates resource definitions in CloudFormation templates; uses JSON/YAML config files


Module 4: Networking

  • A Virtual Private Cloud (VPC) is your own private network in AWS. Some may face the internet, others may be intranets. A subnet is a section of a VPC that can house resources like EC2 instances
  • An Internet Gateway (IGW) must be attached to VPC to reach the internet and for the internet to access resources on the VPC. To do so on a VPN requires a virtual private gateway
  • A physical line is provided by AWS DirectConnect connects your firm's network with the VPC

Subnets and ACLs

  • VPC access--in or out--only covers perimeter access to your assets; nothing internal is covered
  • Layers of security
  1. network hardening
  2. application security
  3. user identity
  4. authentication and authorization
  5. DDoS prevention
  6. data integrity
  7. encryption....and much more
  • Only technical reason for subnets in a VPC is to control access to the gateways; public subnets have access, private ones do not
  • Every packet crossing a gateway is checked against a network access control list (ACL). (EC2) instance level security also needed
  • A Security Group is a virtual firewall controlling in- and outbound traffic for an EC2 instance
  • Default AWS security groups deny all inbound traffic and allow all outbound traffic


Example of Sending a Packet Across Subnets
  1. EC2 A sends a packet to EC2 B
  2. Packet meets security group boundary of instance A. By default, the security group allows all outbound traffic, so it goes
  3. Packet must leave subnet boundary. Packet's destination must be on NACL to pass. (It is.)
  4. Packet proceeds to instance B's subnet. NACL allows it into the subnet. (NACLs deny all inbound and allow outbound traffic by default.) If on B's security group list, it's allowed to proceed

Coming back

  1. Security groups allow all return traffic by default; they let Packet A out without consulting a list
  2. The subnet boundaries (NACLs) are stateless; they must check all rules before letting the packet out
  3. Now back at the instance A subnet, NACLs must check again (because they're stateless)
  4. Final hurdle is the Security Group, which because it's stateful, remembers letting the packet out and thus allows its return


Global Networking

  • Route 53 = Amazon's DNS
  • Uses 1) latency-based, 2) geolocation, 3) geoproximity, 4) weighted round robin
  • Also serves as a registrar
  • Amazon CloudFront: CDN to deliver content to edge locations

Summary

  • Networking: who should be allowed to communicate with each other?
  • VPC, network ACLs, security groups, VPN, DirectConnect (dedicated line)
  • Route 53 for DNS

Module 5: Storage & Databases

Elastic Block Store (EBS)

  • Different EC2 storage types: instance storage volumes (local storage); terminate w/ instance of EC2 running on it (virtually, of course)
  • EBS creates virtual hard drives ("EBS volumes") that attach to EC2 instances and are persistent
  • specify size, type, config and attach an EBS volume to an EC2 instance
  • instance stores provide temporary block storage for EC2 instances
  • EBS provides block-level storage volumes to be used w/ EC2 instances
  • backup using EBS snapshots regularly (they are incremental backups)

Simple Storage Service (S3)

  • object store; objects stored in buckets
  • Tiers: 1) S3 standard, 2) Infrequent Access (S3-IA), 3) S3 Glacier (audits)
  • Also: 1) S3 One Zone-IA (data in single availability zone), 2) Intelligent-Tiering (small fee auto-migrates to IA, Glacier), 3) Glacier Deep Archive (can access objects within 12 hrs)
  • Multiple copies reside across locations (AZs)
EBS vs. S3
  • S3: complete objects or only occasional changes
    • Every object has a URL; S3 comes web-enabled; access rights included
    • Cheaper that running same storage as block-level
  • EBS: complex read/write/update functions
    • updates are fast and incremental vs. updating entire object as in S3
    • Object storage treats items as discrete, singular entities. Block storage uses delta updates

Elastic File System (EFS)

  • auto-scaling, pan-AZ distributed file system (esp for Linux)
  • EBS doesn't scale and is only available in the same AZ as your EC2 instance

Relational Database Service (RDS) and Aurora

  • Can run databases on EC2 directly, but also in the cloud
  • supports MySQL, PostgreSQL, Oracle, Microsoft SQL Server
  • performs backups, upgrades, failover, etc automatically so no ongoing costs
  • Aurora comes w/ MySQL or Postgres and is 10% of normal database cost (no shit sherlock, they're fucking open source).
    • Fully managed service
    • Retains 6 copies of your data at all times (2 per availability zone). Continuous back-ups to S3
    • 5x faster than MySQL and 3x faster than Postgres

DynamoDB

  • severless, infinitely scaleable, NoSQL
  • stores redundantly across AZs. Mirrors data across multiple drives
  • addresses performance and scaling issues of traditional RDBMSs
  • loose, flexible schema can store all types of objects
  • printed 7.11trn API calls and peaked at 45.4 million per second on "Prime Day 2019". wood.

Redshift

  • Data warehouse [math]\displaystyle{ \gets }[/math] data too complex to handle w/ traditional databases
  • Good for "historical" (i.e., not realtime) data, e.g., how many widgets we sold in last hour
  • Data warehousing as a service. Nodes in petabytes.

Additional Services

  • CMS: Amazon DocumentDB
  • Distributed Ledger: Amazon Managed Blockchain
  • Immutable ledger: Amazon QLDB (Quantum Ledger Database)
  • Performance: ElasticCatch (only Memcached and Redis); DAX (DynamoDB Accelerator)
  • Graph database: Amazon Neptune

Category Deep Dive: Databases

Module 6: Security

Module 7: Monitoring & Analytics

Module 8: Pricing & Support

Module 9: Migration & Innovation

Module 10: The Cloud Journey

Module 11: AWS Certified Cloud Practitioner Basics