Auto Scaling Overview

  • Monitors the workload of instances and can add or remove capacity as needed
    • Scaling Up = adding capacity
    • Scaling Down = reducing capacity
  • Allows better cost management
  • Many AWS resources are scalable
Scalable AWS Resources
  • EC2 auto-scaling groups
  • Aurora DB cluster
  • DynamoDB global secondary indexes
  • DynamoDB tables
  • Elastic Container Service (ECS) services
  • Spot fleet requests
Auto Scaling Cost
  • Autoscaling is free to use, however
    • Results of use may incur the cost for
      • More instances
      • CloudWarch
      • ELB load balancers
Auto Scaling Groups
  • Collection of instances with similar characteristics
  • Scaled based on selected/ defined criteria
  • Unhealthy instances can be automatically replaced
    • “Unhealthy” is any state but Running
Auto Scaling Group Considerations
  • Time to launch and configure a server
  • Relevant metrics to the application
    • CPU utilization
    • Network throughput
    • Free memory
  • What Availability Zones (ASs) should the Auto Scaling group span
  • Scale to increase or decrease capacity
  • Specify the minimum number of instances always running
OptionDescriptionImpacts
Scaling OutAdding Resources– Better performance, redundancy
– Increased cost
Scaling InRemoving Resources– Cost saving

Termination Polity
  • By default, it’s based on the oldest configuration within the AZ
  • By costing – closest to the next billable instance hour
  • Custom Termination Policy:
    • OldestInstance (can be used to handle “lack of restart” performance issues)
    • NewestInstance
    • OldestLaunchConfig (default)
    • ClosestToNExtInstanceHour (cost-based, can be used to reduce cost)

By default Auto Scaling Termination Policy first terminates instances in the AZ with the most instances. Auto Scaling Groups can be created from the EC2 instance launch screen. A launch configuration is required to create an Auto Scaling Group, as it contains the instance type, a key-pair, security group and more.

Launch Methods
  • A Launch Template can be used to create an Auto Scaling Group
  • A Launch Configuration can be used to create an Auto Scaling Group
  • An existing EC2 instance can be used to create an Auto Scaling Group

Load Balancing

Example of Application Load Balancer with AWS PrivateLink

Load Balancers watch for incoming requests and then direct them to one of many instances in the load balancing configuration based on a selected algorithm.

Load Balancing Categories
Sender InitiatedReceiver Initiated
Sender located the best targetThe receiver selects the best target
True Load Balancing

Static Load Balancing
  • Multi-tier applications
    • Specific actions are assigned to specific servers/ resources
    • Actions are always processed on the assigned targets
    • No scalability
Dynamic Load Balancing
  • True load balancing
    • Actions are dynamically assigned to resources
    • Scalability is provided
  • Used by AWS Elastic Load Balancing (EBS)
Load Balancing Algorithms
  • Round-robin (RR) — rotates through available nodes)
  • Weighted Round Robin
  • Randomize
  • Centrally Managed
  • Threshold Based
Elastic Load Balancer (EBS)
ELB Benefits
  • Highly available service
  • Secure
  • Flexible, elastic
  • Monitoring and auditing included
  • Hybrid – can implement more than one type
EBS Types
  • Classic Load Balancer
    • Legacy and not recommended for any new applications
    • EC2 Classic Only
    • Support for SSL and TCP for load balancing
  • Application Load Balancer
    • Focus on HTTP/ HTTPS traffic
    • Layer 7 of the OSI Model
  • Network Load Balancer
    • Focus on TCP traffic
    • Layer 4 of the OSI Model
Supported Services
  • EC2
  • ECS
  • Auto Scaling
  • CloudWatch
  • Route 53

DNS Overview

  • DNS – Domain Name System
  • Provides hierarchical namespace for the hostname to IP address resource resolution management
  • Based on RFC (Request for Comments) 1034 and 1034
  • Domains are defined as specific boundaries of activity
  • DNS provides name to IP address mapping

Fully Qualified Domain Name (FQDN) includes the host name and the domain name e.g. for host “www” at the domain “amazon.com” the FQDN is www.amazon.com

Each VPC has a DNS configuration set. Multiple parameters can be configured for DNS in each VPS as well. Each EC2 instance has a generated DNS host name. To use alternative DNS host name Route 53 service can be used.

DNS Hosting
  • Provides name resolution
    • Caching
    • Recursion
    • DNS zone transfers
    • Offloads name resolution process
  • Store DNS database
DNS Resolution
  • Request an IP address of a hostname (Name -> IP)
    • Forward Lookup
  • Request hostname of an IP address (IP -> Name)
    • Reverse Lookup
  • The request is configured with a DNS server address
    • e.g. 8.8.8.8 = Google
DNS Records
  • A to AAAA
    • Hostname > IPv4 or IPv6
  • NS
    • Domain > Hostname
  • MX
    • Mail Record
  • CNAME
    • Alias for the real name
    • Canonical Name Record 
Route 53
  • Managed service, can import zone files
  • Provides DNS services including domain name registration, DNS resolution, management and health checks
  • Domain names registered outside of AWS will have to be redirected to the Route 53 service
ACLs and NACLs
  • S3 buckets can use Access Control Lists (ACLs) to determine who has R/W access
  • VPCs and subnets can also use ACLs
  • ACLs can be configured in the management console and CLI
Flow Logs
  • Allow logging traffic passing through the VPC
  • Can be created on the network interfaces, VPCs, and subnets
  • Store the logs in the CloudWatch service
    • Because of this, there’s cost associated with Flow Logs
  • Can be used as Intrusion Prevention System