Amazon Web Services


Survol et acronymes essentiels


Region : us-east, us-west, ca-central
Availibility Zone (AZ) us-east-1 (min 3, max 6)
Data centers : at least two per AZ

Criteria to choose a region
  1) Proximity (latency)
  2) Legal (political)
  3) Service availabilty
  4) Cost ($, Euro)


Cloud
  0) On-premise (on-site)
  1) IasS (infrastruction as a service), machine, os on AWS, user installs DB, SDK
  2) PaaS (platform as a service), machine, os, web server on AWS, user installs web application
  3) SaaS (software as a service), machine, os, web server, s/w on AWS, user enters data

Cloud
  Vertical vs Horizontal (Elastic) Scalability

Access AWS
   AWS Management Console (web)
   AWS Command Line Interface (CLI) shell
   AWS Software Development Kit (SDK)

Services
  Global service : IAM, Route53 (DNS redirect), CloudFront (ressource cache).

  IAM = Identity and Access Management, security, user management.
    IAM User, user group, role, policy.
    MFA device, virtual MFA device (Google Authentification, Duo), Security key, H/W TOTP token
 
  IAM Security Tools
    IAM credential report - reporting users' status (cvs format)
    IAM access advisor - user permissions for service, last access

  IAM Guidelines
    root only for root usage
    least privilege rule
    one physical user 1..1 one AWS user
    strong policy password. MFA

  Billing and Payments

  EC2 = Elastic Compute Cloud (rent VM, virtual machine), IaaS
    options : OS (Linux, Windows), CPU, RAM
    EC2 instance : VM
    EC2 instance type : m5.2xlarge
    Security Group : access traffic to EC2 "wirewall",
      access to ports (21 FTP, 22 SSH, 80 HTTP, 443 HHTPS), IP ranges, inbound or outbound 
    EC2 Instance connect : shell interface in web browser
    EC2 Instances purchasing options
      (on-demand pay per second, reserved, saving plans (by $), spot instances
    EBS : elastic block storage, storing virtual drive (network USB stick), free 30 GB
    EBS snapshots -> EBS backup
    EC2 Instance store -> better perform than EBS
    AMI : Amazon Machine Image (customization of a EC2 instance)
      create 100 Windows 8GB-RAM virtual machine in a batch w/ preloaded s/w (word, etc.)
    EFS : Elastic File System (network file system, POSIX file system ~Linux)
    EFS storage tiers (standard (internal HD), infrequent access cheaper (external drive), archive (tape))
    ELB : elastic load balancers
      ELB ALB : Application Load Balancer (level 7), HTTP, HTTPS
      ELB NLB : Network Load Balancer (level 4) TCP, UDP
      ELB NLB : Gateway Load Balancer (level 3) IP packet, GENEVE protocol
      ELB stiky sessions, cookie-based, session to the same target
      ELB cross-zone balancing
      User (HTTPS) ELB (HTTP) EC2 instance 
    ASG : auto-scaling group : scale in/out (remove/add) EC instances
      ASG policy (min capacity=2, desired=4, max=8)
      ASG (dynamic (as CPU is used), scheduled (on business hours), predictive (new promotion), scaling)
      CloudWatch alarms (metrics such as avg CPU usage)
    RDS : Relational Database Server
      stored on ESB (autoscaled)
      RDS (up to) read replicas (for SELECT, not INSERT, UPDATE..), useful for reports
      Multi AZ (Disaster Recovery)
    ElastiCache : in-memory (cache) for DB
      Redis vs Memcached
      Lazy loading strategy (lazy population, cache-aside)
      Write Thru strategy
      Cache Evictions and Time-to-live (TTL)

   DNS (Domain Name System) : IP phone book
      Domain registrar (GoDaddy, AWS Route53)
      DNS records (A, AAAA, CNAME (refered to A or AAAA), NS (name server address)
      TLD (Top-level domain) : .com .org
   Route53 : DNS server (53 is DNS port)


   VPC : Virtual Private Cloud
     Subnet : public or private
     NACL : Network ACL (Access Control List)
     VPC Flow Logs : log all the traffic
     Three tier solution architecture (User -> (Public Subnet) ELB -> Private Subnet (ASG) -> Data Subnet)

  S3 : Simple Storage Service
    Objects=file, buckets=root-level folders, key=file path
    S3 Bucket Policies
    CRR=Cross Region Replication, SRR=Same Region Replication
    S3 Storage Classes : standard, infrequent-access (for backup), glacier instant, flexible (minutes), deep
    Lifecycle rules
    S3 Event notifications
    Amazon EventBride : events for other AWS services
    Encryption : SSE (Server-side encryption), KMS (key-management service)
    S3 Access logs : log in another bucket!



  AWS CloudFront : Content Delivery Network (CDN), uses edge locations to cache ressources, protects DDoS

  Amazon ECS (Elastic Container Service) : Docker
    Amazon EKS (Elastic Kubernetes Service) : Kubernetes
    Amazon ECR (Elastic Container Registry) : Docker images
    Amazon Fargate (Amazon Serverless container platform)
    Case : EventBridge every-hour event -> run ESC task -> store SE (serverless)
    AWS Copilot : CLI-tool to build apps on Fargate, ECS

  Amazon Beanstalk - developer-centric
   Deployment strategies :
     all at once (+fatest, -downtime),
     rolling (slowdown)
     rolling w/ additional batches (more cost during deployment)
     traffic splitting (canary testing)
     CloudFormation : used by Beanstalk
     LifeCycle Policy : automate deletions of older versions

==

  CloudFormation : specify configuration (how many S3 buckets, etc.), kind of batch file to execution
     Estimate costs $$
     Generate diagrams

  Queueing
  Amazon SQS : Simple Queue Service (cf. ActiveMQ) decoupled applications

  Logging
  CloudWatch : collect metrics, logs, send events, alarms.
  AWS X-Ray  traces : for distributed architecture (micro-services)
   Trace Analysius & Visual Tools
   Needs to insert calls in application code.
   Visual : follows request among services.
  CloudTrail : app traces

  Serverless
    AWS Lambda
    DynamoDB : NoSQL Serveless DB (cf MongoDB)
    Amazon S3

  DynamoDB
    Traditional architecture : User -> ELB -> ASG -> EC2 app (app layer) -> DB layer
    DB has tables, table has PK, has attributes (cf. column, but nested)

  API Gateway (REST API)

  CICD (Continuous integration, continuous delivery)
    AWS CodeCommit -> replaced by GitHub, GitLab, Bitbucket
    AWS CodeBuild  cf. Jenkins CI
    AWS CodeDeploy
    AWS CodePipeline (orchestrating)

  AWS SAM (Serverless App Model)

  Security
    Encryption in flight HTTPS : TLS new version of SSL
    Encryption at rest
      server-side encryp. client-side encrypt.
    AWS KMS (key management service)