5: Networking and Content Delivery

    Implementing Networking Features and Connectivity

    This section frames the networking-and-connectivity surface a CloudOps engineer operates on AWS and then dives into edge content distribution with Amazon CloudFront and AWS Global Accelerator, the two services that connect external clients into AWS infrastructure. The remaining mechanics (VPC primitives, hybrid links, network protection, cost, DNS, and troubleshooting) are split into their own sections so each gets full depth.

    The operator's networking layer in AWS is built from independent control planes that compose. The address-space plane (VPC, subnets, IPAM) decides what IP ranges exist. The reachability plane (route tables, NACLs, security groups, NAT, gateways, Transit Gateway, peering, PrivateLink, VPN, Direct Connect) decides what can talk to what. The name-resolution and edge plane (Route 53 public and private hosted zones, Resolver endpoints, CloudFront, Global Accelerator) decides how clients find services. The protection plane (DNS Firewall, AWS WAF, Shield, Network Firewall) decides what is allowed through. CloudOps work is mostly orchestrating the routing, protection, and observability of those layers, not designing greenfield topology from scratch.

    Two services own the inbound edge: Amazon CloudFront accelerates and protects HTTP and HTTPS, and AWS Global Accelerator routes any TCP or UDP workload to the closest healthy AWS endpoint over the AWS backbone using two static anycast IPv4 addresses. Both terminate client connections at AWS edge locations, both bring traffic onto the AWS global network earlier in the path, and both ship with first-class Shield integration. They differ in protocol, caching, and stickiness behavior, which is the choice the exam tests.

    CloudFront is a content-delivery network: it caches at over 600 points of presence, supports custom origins (S3, ALB, NLB, EC2, MediaPackage, third-party HTTP), terminates TLS with SNI or dedicated IP, evaluates AWS WAF rules close to the viewer, runs CloudFront Functions and Lambda@Edge at the edge, and applies cache and origin-request policies that decide which request attributes form the cache key. Operators tune the cache key, TTL, origin failover, and Origin Access Control (OAC) for S3 origins. Origin Access Control is the recommended replacement for Origin Access Identity (OAI); OAC supports SSE-KMS, server-side request signing for SigV4, and all S3 Regions.

    # Create a cache policy that strips cookies and query strings to maximize hit ratio
    aws cloudfront create-cache-policy \
     --cache-policy-config '{
     "Name": "static-assets-cache",
     "DefaultTTL": 86400,
     "MinTTL": 60,
     "MaxTTL": 31536000,
     "ParametersInCacheKeyAndForwardedToOrigin": {
     "EnableAcceptEncodingGzip": true,
     "EnableAcceptEncodingBrotli": true,
     "HeadersConfig": {"HeaderBehavior": "none"},
     "QueryStringsConfig": {"QueryStringBehavior": "none"},
     "CookiesConfig": {"CookieBehavior": "none"}
     }
     }'
    

    A CloudFront distribution can carry up to 25 origins per distribution and up to 25 cache behaviors. Custom origins behind an ALB or NLB can be locked down by adding a custom header that AWS WAF or the origin checks for, or by attaching the AWS managed prefix list com.amazonaws.global.cloudfront.origin-facing to the security group instead of opening 0.0.0.0/0. The prefix list keeps the security group automatically updated as CloudFront IP ranges change, removing the operational burden of maintaining IP allow lists.

    Global Accelerator works at a different layer. It exposes two static anycast IPv4 addresses (you can also bring your own IPv4) backed by listeners (TCP or UDP, port ranges) and endpoint groups in chosen Regions. Within an endpoint group, traffic is split across endpoints (ALB, NLB, EC2, Elastic IP) by weight. Failover is health-check driven and happens in tens of seconds because clients keep talking to the same anycast IP while the AWS edge re-routes inside the backbone. Client IP preservation is supported with ALB and EC2 endpoints; with NLB endpoints, the original client IP arrives naturally because NLB is layer 4.

    # Create a Global Accelerator with two endpoint groups for active/active across Regions
    ACC_ARN=$(aws globalaccelerator create-accelerator \
     --name payments-anycast \
     --ip-address-type IPV4 \
     --enabled \
     --query 'Accelerator.AcceleratorArn' --output text)
    
    LISTENER_ARN=$(aws globalaccelerator create-listener \
     --accelerator-arn "$ACC_ARN" \
     --port-ranges FromPort=443,ToPort=443 \
     --protocol TCP \
     --client-affinity NONE \
     --query 'Listener.ListenerArn' --output text)
    
    aws globalaccelerator create-endpoint-group \
     --listener-arn "$LISTENER_ARN" \
     --endpoint-group-region eu-west-1 \
     --traffic-dial-percentage 100 \
     --health-check-port 443 \
     --health-check-protocol TCP \
     --endpoint-configurations 'EndpointId=arn:aws:elasticloadbalancing:eu-west-1:111122223333:loadbalancer/app/payments-eu/abc,Weight=128,ClientIPPreservationEnabled=true'
    

    Content and Service Distribution with Amazon CloudFront and AWS Global Accelerator

    Operators pick CloudFront when the workload is HTTP and benefits from caching: web assets, video segments, REST and GraphQL APIs that can tolerate cache hits on read endpoints, signed-URL distribution, and AWS WAF protection at the viewer edge. CloudFront delivers viewer-to-edge TLS termination, HTTP/2 and HTTP/3, Brotli and Gzip compression at no charge, range GET coalescing, and origin shield to centralize origin requests through a designated Region.

    Global Accelerator is the choice for non-HTTP TCP and UDP, for workloads needing static anycast IPs to whitelist (financial counterparties, IoT MQTT brokers, multiplayer game servers), and for HTTP workloads that need sub-minute Region failover without DNS TTL exposure. Because Global Accelerator answers on the same two anycast IPs regardless of Region failover, downstream firewall allowlists never need to change. CloudFront, by contrast, advertises a distribution domain (d123abcXYZ.cloudfront.net) whose IP set rotates frequently, so allowlisting downstream of CloudFront uses the AWS managed prefix list com.amazonaws.global.cloudfront.origin-facing rather than literal IPs.

    Decision inputPick CloudFrontPick Global Accelerator
    ProtocolHTTP, HTTPS, WebSocket over HTTPAny TCP or UDP (incl. SSH, MQTT, RTSP)
    Caching at edgeYes (cache and origin policies)No
    Edge AWS WAFYes (CLOUDFRONT scope)No (attach AWS WAF to ALB/origin)
    Static IPs for allowlistingNo (use prefix list)Yes (two anycast IPv4)
    Fastest Region failoverMinutes (DNS TTL bound)Tens of seconds (anycast reroute)
    Native non-HTTPNoYes
    Origin shieldYes (one Region per distribution)Not applicable
    Client IP preservationAlwaysOptional (ALB/EC2 endpoints)

    💡 Exam Trap: Choosing CloudFront for a non-HTTP gaming workload is wrong: CloudFront accepts only HTTP and HTTPS. Pick Global Accelerator for any TCP or UDP listener that is not HTTP-shaped.

    💡 Exam Trap: Locking an ALB origin to CloudFront with a literal IP allowlist breaks the next time AWS publishes new edge ranges. Use the com.amazonaws.global.cloudfront.origin-facing managed prefix list in the security group, paired with a secret custom header the ALB or AWS WAF checks.

    ⚠️ Anti-Pattern: Using Global Accelerator in front of an S3 static website to "make it faster." S3 static-website endpoints are HTTP-only origins that benefit from CloudFront caching; Global Accelerator does not cache and adds cost without benefit. Pair S3 with CloudFront and OAC instead.

    📊 Limit: A CloudFront distribution supports up to 25 origins and up to 25 cache behaviors by default; an AWS account can hold up to 200 distributions before quota increase. Global Accelerator supports up to 10 listeners per accelerator and up to 10 endpoint groups per listener.

    🎯 Scenario: A trading platform exposes a public REST API on an ALB in eu-west-1 and a backup ALB in eu-west-2. Counterparties whitelist two static IPs in their outbound firewalls and require fail-over inside 60 seconds. CloudFront would force counterparties to whitelist a moving prefix list and DNS-TTL fail-over. Global Accelerator gives two anycast IPs that survive the Region cutover, and traffic-dial percentages let operators drain the secondary endpoint group during testing.

    Decision Anchor. Choose CloudFront when the workload is HTTP and cacheable or needs edge AWS WAF, signed URLs, or Lambda@Edge processing. Choose Global Accelerator when the workload is non-HTTP, requires static IP allowlisting, or needs sub-minute multi-Region failover without DNS TTL exposure. The two services can be combined when an HTTP API needs both static IPs and edge caching, by placing Global Accelerator in front of an ALB and CloudFront in front of static assets.

    CloudOps responsibility for both services includes monitoring delivery health (CloudFront TotalErrorRate, 5xxErrorRate, BytesDownloaded; Global Accelerator NewFlowCount, ProcessedBytesIn, endpoint group health), driving cache hit ratio (CloudFront CacheHitRate), and rotating ACM public certificates that CloudFront uses (CloudFront requires certificates in us-east-1 regardless of origin Region; Global Accelerator listeners do not terminate TLS, so ACM is not required at the accelerator).

    # Track CloudFront cache hit ratio and 5xx error rate as composite alarm signals
    aws cloudwatch put-metric-alarm \
     --alarm-name cloudfront-cache-hit-low \
     --namespace AWS/CloudFront \
     --metric-name CacheHitRate \
     --dimensions Name=DistributionId,Value=EDFDVBD6EXAMPLE Name=Region,Value=Global \
     --statistic Average --period 300 --evaluation-periods 3 \
     --threshold 70 --comparison-operator LessThanThreshold \
     --alarm-actions arn:aws:sns:us-east-1:111122223333:network-ops
    

    The thread that ties this section to the rest of the chapter is that everything beyond the edge plane lives inside VPCs the operator owns, and the operator chooses how to expose it (CloudFront, Global Accelerator, ALB, NLB, PrivateLink) and how to protect it (Shield, AWS WAF, Network Firewall, security groups). The remaining sections operate on those decisions.


    Continue with the interactive course

    Track your progress, jump into practice questions and use the Shark AI tutor inside the AWS - CloudOps Engineer Associate learning hub.