AWS Global Infrastructure

AWS Global Network
AWS Infrastructure Groupings

AWS Region

AWS Availability Zone (AZ)

AWS Edge Location (Point of Presence / PoP)

Resilience of an AWS Service
  1. Global resilience
    • A global service operates as a single system with a centralized data layer
      • Data is replicated across multiple regions
      • The service can continue functioning even if an entire region fails
    • Examples include IAM and Route 53
  2. Regional resilience
    • A regional service runs within a specific region, using a database located in that region
      • Data is replicated across all AZs within the region
      • Can tolerate failure of a single AZ
      • If the entire region fails, the service becomes unavailable in that region
    • Examples include VPC and S3
      • S3 bucket names are globally unique, but the data resides within a region
  3. Availability Zone (AZ) resilience
    • The service operates within a single AZ
      • More vulnerable to failure compared to regional or global services
      • However, architectures can still achieve high availability by distributing workloads across AZs
    • Hardware-level failures may occur without taking down the entire AZ
    • Examples include EC2 and RDS

Amazon S3 (Simple Storage Service) 101

Amazon S3 – Core Concepts
S3 Objects
S3 Bucket

Example: /images/badges.jpg appears under /images/, but /images/ is not a folder, just a prefix used to filter/display objects

Amazon VPC (Virtual Private Cloud) 101

Amazon VPC – Core Concepts
Default VPC

Default VPC – Reference Diagram:

Amazon EC2 (Elastic Compute Cloud) 101

Amazon EC2 – Core Concepts
EC2 Instances

EC2 Instance State

Connecting to EC2 Instances via SSH

Connecting to Older Windows Instances via RDP

Amazon Machine Image (AMI)

Amazon CloudWatch (CW) 101

Amazon CloudWatch – Components and Architecture
Amazon CloudWatch – Key Concepts

AWS CloudFormation (CFN) 101

https://youtube.com/watch?v=ptvce7lJ6Z0%3Ffeature%3Doembed
IaC Basics and AWS CloudFormation
CFN Templates – Structure and Components

Example templates in YAML/JSON:

Example:

Example:

Example:

Example:

Example:

CFN Stacks
Syncing Logical and Physical Resources

AWS Lambda 101

AWS Lambda – Key Concepts
AWS Lambda – Architecture
AWS Lambda – Common Use Cases
Demo: Create and Test a Lambda Function
  1. Deploy the CloudFormation stack provided in the demo, which creates two EC2 instances
  2. Create an execution role:
    • Either in IAM or during Lambda creation.
    • Example JSON policy (allow Lambda to start/stop EC2 instances and log to CloudWatch):
    {
    “Version”: “2012-10-17”,
    “Statement”: [
    {
    “Effect”: “Allow”,
    “Action”: [
    “logs:CreateLogGroup”,
    “logs:CreateLogStream”,
    “logs:PutLogEvents”
    ],
    “Resource”: “arn:aws:logs:*:*:*”
    },
    {
    “Effect”: “Allow”,
    “Action”: [
    “ec2:Start*”,
    “ec2:Stop*”
    ],
    “Resource”: “*”
    }
    ]
    }

3. Go to Services → Lambda → Create Function
A. Enter a function name and select a runtime (Python 3.9 in demo)

B. Assign the execution role created earlier

  1. Once the function is created, add the code to stop EC2 instances:

A. Stop EC2 instances Python script

import boto3
import os
import jsonregion = 'us-east-1'
ec2 = boto3.client('ec2', region_name=region)def lambda_handler(event, context):
instances = os.environ['EC2_INSTANCES'].split(",")
ec2.stop_instances(InstanceIds=instances)
print('stopped instances: ' + str(instances))

B. Paste the code into the Lambda function editor

  1. Set Environment Variables
    • Go to Configurations → Environment variables.
    • Add a variable named EC2_INSTANCES with the EC2 instance IDs, separated by commas (no spaces).
  2. Test the function
    • Click Test (no event input needed).
    • After execution, check the EC2 console to confirm the instances were stopped.
  3. Create another function to start EC2 instances in a similar way:

A. Start EC2 instances Python script

import boto3
import os
import jsonregion = 'us-east-1'
ec2 = boto3.client('ec2', region_name=region)def lambda_handler(event, context):
instances = os.environ['EC2_INSTANCES'].split(",")
ec2.start_instances(InstanceIds=instances)
print('started instances: ' + str(instances))

B. Test the function and verify in the EC2 console that the instances were started.

  1. Clean-up
    • Delete the Lambda functions created.
    • Delete the CloudFormation stack used for the demo.

Amazon R53 (Route 53) 101

Amazon Route 53 – Key Concepts
Registered Domains
Hosted Zones