Amazon Web Services in Action, Third Edition

Book description

Master essential best practices for deploying and managing applications on Amazon Web Services. This revised bestseller is packed with techniques for building highly available and scalable architectures and automating deployment with Infrastructure as Code.

  • Leverage globally distributed data centers to launch virtual machines with EC2
  • Store and archive large volumes of data with EBS, S3, and EFS
  • Persist and query data with highly available and scalable database systems with RDS and DynamoDB
  • Enhance performance with caching data in-memory with ElastiCache and MemoryDB
  • Use Infrastructure as Code to automate your cloud infrastructure
  • Secure workloads running in the cloud with VPC and IAM
  • Build fault-tolerant web applications with ALB and SQS
  • Automate common sysadmin tasks with Lambda, CLI, and SDK
  • Build cloud-native applications based on containers with AppRunner, ECS, Fargate

Thousands of developers have chosen Amazon Web Services in Action: An in-depth guide to AWS to help them succeed with the AWS cloud. Readers love this all-practical handbook for its complete introduction to computing, storage, and networking, along with best practices for all core AWS services. This revised third edition features new chapters on containerization, along with a variety of AWS innovations. You’ll also learn how automating your infrastructure with IAC is a game changer for your cloud deployment, delivering a massive boost to efficiency and quality.

About the Technology
Amazon Web Services, the leading cloud computing platform, offers customers APIs for on-demand access to computing services. Rich in examples and best practices of how to use AWS, this Manning bestseller is now released in its third, revised, and improved edition.

About the Book
In Amazon Web Services in Action, Third Edition: An in-depth guide to AWS, the Wittig brothers give you a comprehensive, practical introduction to deploying and managing applications on the AWS cloud platform. With a sharp focus on the most important AWS tasks and services, they will save you hours of unproductive time. You’ll learn hands-on as you complete real-world projects like hosting a WordPress site, setting up a private cloud, and deploying an app on containers.

What's Inside
  • Leverage globally distributed data centers to launch virtual machines
  • Enhance performance with caching data in-memory
  • Secure workloads running in the cloud with VPC and IAM
  • Build fault-tolerant web applications with ALB and SQS


About the Reader
Written for mid-level developers, DevOps or platform engineers, architects, and system administrators.

About the Author
Andreas Wittig and Michael Wittig are software engineers and consultants focused on AWS. Together, they migrated the first bank in Germany to AWS in 2013.

Quotes
Up-to-date coverage. Code examples and configurations are all excellent. Even containerization is very well explained. This is the bible for Amazon Web Services.
- Mohammad Shahnawaz Akhter, Bank of America

It has never been so easy to learn AWS.
- Jorge Ezequiel Bo, TravelX

Essential for those who decide to embark on the Amazon cloud journey.
- Matteo Rossi, UnipolSai Assicurazioni

A complete introduction to the most important AWS Services with very useful practical examples.
- Matteo Battista, GamePix

Publisher resources

View/Submit Errata

Table of contents

  1. inside front cover
    1. AWS Services Explained in the Book
  2. Amazon Web Services in Action
  3. Praise for the second edition
  4. Copyright
  5. brief contents
  6. contents
  7. front matter
    1. preface
    2. acknowledgments
    3. about this book
      1. About the third edition
      2. Who should read this book
      3. How this book is organized: A road map
      4. AWS costs
      5. About the code
      6. liveBook discussion forum
    4. about the authors
    5. about the cover illustration
  8. Part 1. Getting started
  9. 1 What is Amazon Web Services?
    1. 1.1 What is Amazon Web Services (AWS)?
    2. 1.2 What can you do with AWS?
      1. 1.2.1 Hosting a web shop
      2. 1.2.2 Running a Java EE application in your private network
      3. 1.2.3 Implementing a highly available system
      4. 1.2.4 Profiting from low costs for batch processing infrastructure
    3. 1.3 How you can benefit from using AWS
      1. 1.3.1 Innovative and fast-growing platform
      2. 1.3.2 Services solve common problems
      3. 1.3.3 Enabling automation
      4. 1.3.4 Flexible capacity (scalability)
      5. 1.3.5 Built for failure (reliability)
      6. 1.3.6 Reducing time to market
      7. 1.3.7 Benefiting from economies of scale
      8. 1.3.8 Global infrastructure
      9. 1.3.9 Professional partner
    4. 1.4 How much does it cost?
      1. 1.4.1 Free Tier
      2. 1.4.2 Billing example
      3. 1.4.3 Pay-per-use opportunities
    5. 1.5 Comparing alternatives
    6. 1.6 Exploring AWS services
    7. 1.7 Interacting with AWS
      1. 1.7.1 Management Console
      2. 1.7.2 Command-line interface
      3. 1.7.3 SDKs
      4. 1.7.4 Blueprints
    8. 1.8 Creating an AWS account
      1. 1.8.1 Signing up
      2. 1.8.2 Signing in
    9. 1.9 Creating a budget alert to keep track of your AWS bill
    10. Summary
  10. 2 A simple example: WordPress in 15 minutes
    1. 2.1 Creating your infrastructure
    2. 2.2 Exploring your infrastructure
      1. 2.2.1 Virtual machines
      2. 2.2.2 Load balancer
      3. 2.2.3 MySQL database
      4. 2.2.4 Network filesystem
    3. 2.3 How much does it cost?
    4. 2.4 Deleting your infrastructure
    5. Summary
  11. Part 2. Building virtual infrastructure consisting of computers and networking
  12. 3 Using virtual machines: EC2
    1. 3.1 Exploring a virtual machine
      1. 3.1.1 Launching a virtual machine
      2. 3.1.2 Connecting to your virtual machine
      3. 3.1.3 Installing and running software manually
    2. 3.2 Monitoring and debugging a virtual machine
      1. 3.2.1 Showing logs from a virtual machine
      2. 3.2.2 Monitoring the load of a virtual machine
    3. 3.3 Shutting down a virtual machine
    4. 3.4 Changing the size of a virtual machine
    5. 3.5 Starting a virtual machine in another data center
    6. 3.6 Allocating a public IP address
    7. 3.7 Adding an additional network interface to a virtual machine
    8. 3.8 Optimizing costs for virtual machines
      1. 3.8.1 Commit to usage, get a discount
      2. 3.8.2 Taking advantage of spare compute capacity
    9. Summary
  13. 4 Programming your infrastructure: The command line, SDKs, and CloudFormation
    1. 4.1 Automation and the DevOps movement
      1. 4.1.1 Why should you automate?
    2. 4.2 Using the command-line interface
      1. 4.2.1 Installing the CLI
      2. 4.2.2 Configuring the CLI
      3. 4.2.3 Using the CLI
      4. 4.2.4 Automating with the CLI
    3. 4.3 Programming with the SDK
      1. 4.3.1 Controlling virtual machines with SDK: nodecc
      2. 4.3.2 How nodecc creates a virtual machine
      3. 4.3.3 How nodecc lists virtual machines and shows virtual machine details
      4. 4.3.4 How nodecc terminates a virtual machine
    4. 4.4 Infrastructure as Code
      1. 4.4.1 Inventing an infrastructure language: JIML
    5. 4.5 Using AWS CloudFormation to start a virtual machine
      1. 4.5.1 Anatomy of a CloudFormation template
      2. 4.5.2 Creating your first template
      3. 4.5.3 Updating infrastructure using CloudFormation
    6. Summary
  14. 5 Securing your system: IAM, security groups, and VPC
    1. 5.1 Who’s responsible for security?
    2. 5.2 Keeping the operating system up-to-date
    3. 5.3 Securing your AWS account
      1. 5.3.1 Securing your AWS account’s root user
      2. 5.3.2 AWS Identity and Access Management (IAM)
      3. 5.3.3 Defining permissions with an IAM identity policy
      4. 5.3.4 Users for authentication and groups to organize users
      5. 5.3.5 Authenticating AWS resources with roles
    4. 5.4 Controlling network traffic to and from your virtual machine
      1. 5.4.1 Controlling traffic to virtual machines with security groups
      2. 5.4.2 Allowing ICMP traffic
      3. 5.4.3 Allowing HTTP traffic
      4. 5.4.4 Allowing HTTP traffic from a specific source IP address
      5. 5.4.5 Allowing HTTP traffic from a source security group
    5. 5.5 Creating a private network in the cloud: Amazon Virtual Private Cloud (VPC)
      1. 5.5.1 Creating the VPC and an internet gateway (IGW)
      2. 5.5.2 Defining the public proxy subnet
      3. 5.5.3 Adding the private backend subnet
      4. 5.5.4 Launching virtual machines in the subnets
      5. 5.5.5 Accessing the internet from private subnets via a NAT gateway
    6. Summary
  15. 6 Automating operational tasks with Lambda
    1. 6.1 Executing your code with AWS Lambda
      1. 6.1.1 What is serverless?
      2. 6.1.2 Running your code on AWS Lambda
      3. 6.1.3 Comparing AWS Lambda with virtual machines (Amazon EC2)
    2. 6.2 Building a website health check with AWS Lambda
      1. 6.2.1 Creating a Lambda function
      2. 6.2.2 Use CloudWatch to search through your Lambda function’s logs
      3. 6.2.3 Monitoring a Lambda function with CloudWatch metrics and alarms
      4. 6.2.4 Accessing endpoints within a VPC
    3. 6.3 Adding a tag containing the owner of an EC2 instance automatically
      1. 6.3.1 Event-driven: Subscribing to EventBridge events
      2. 6.3.2 Implementing the Lambda function in Python
      3. 6.3.3 Setting up a Lambda function with the Serverless Application Model (SAM)
      4. 6.3.4 Authorizing a Lambda function to use other AWS services with an IAM role
      5. 6.3.5 Deploying a Lambda function with SAM
    4. 6.4 What else can you do with AWS Lambda?
      1. 6.4.1 What are the limitations of AWS Lambda?
      2. 6.4.2 Effects of the serverless pricing model
      3. 6.4.3 Use case: Web application
      4. 6.4.4 Use case: Data processing
      5. 6.4.5 Use case: IoT backend
    5. Summary
  16. Part 3. Storing data in the cloud
  17. 7 Storing your objects: S3
    1. 7.1 What is an object store?
    2. 7.2 Amazon S3
    3. 7.3 Backing up your data on S3 with AWS CLI
    4. 7.4 Archiving objects to optimize costs
    5. 7.5 Storing objects programmatically
      1. 7.5.1 Setting up an S3 bucket
      2. 7.5.2 Installing a web application that uses S3
      3. 7.5.3 Reviewing code access S3 with SDK
    6. 7.6 Using S3 for static web hosting
      1. 7.6.1 Creating a bucket and uploading a static website
      2. 7.6.2 Configuring a bucket for static web hosting
      3. 7.6.3 Accessing a website hosted on S3
    7. 7.7 Protecting data from unauthorized access
    8. 7.8 Optimizing performance
    9. Summary
  18. 8 Storing data on hard drives: EBS and instance store
    1. 8.1 Elastic Block Store (EBS): Persistent block-level storage attached over the network
      1. 8.1.1 Creating an EBS volume and attaching it to your EC2 instance
      2. 8.1.2 Using EBS
      3. 8.1.3 Tweaking performance
      4. 8.1.4 Backing up your data with EBS snapshots
    2. 8.2 Instance store: Temporary block-level storage
      1. 8.2.1 Using an instance store
      2. 8.2.2 Testing performance
      3. 8.2.3 Backing up your data
    3. Summary
  19. 9 Sharing data volumes between machines: EFS
    1. 9.1 Creating a filesystem
      1. 9.1.1 Using CloudFormation to describe a filesystem
      2. 9.1.2 Pricing
    2. 9.2 Creating a mount target
    3. 9.3 Mounting the EFS filesystem on EC2 instances
    4. 9.4 Sharing files between EC2 instances
    5. 9.5 Tweaking performance
      1. 9.5.1 Performance mode
      2. 9.5.2 Throughput mode
      3. 9.5.3 Storage class affects performance
    6. 9.6 Backing up your data
    7. Summary
  20. 10 Using a relational database service: RDS
    1. 10.1 Starting a MySQL database
      1. 10.1.1 Launching a WordPress platform with an RDS database
      2. 10.1.2 Exploring an RDS database instance with a MySQL engine
      3. 10.1.3 Pricing for Amazon RDS
    2. 10.2 Importing data into a database
    3. 10.3 Backing up and restoring your database
      1. 10.3.1 Configuring automated snapshots
      2. 10.3.2 Creating snapshots manually
      3. 10.3.3 Restoring a database
      4. 10.3.4 Copying a database to another region
      5. 10.3.5 Calculating the cost of snapshots
    4. 10.4 Controlling access to a database
      1. 10.4.1 Controlling access to the configuration of an RDS database
      2. 10.4.2 Controlling network access to an RDS database
      3. 10.4.3 Controlling data access
    5. 10.5 Building on a highly available database
      1. 10.5.1 Enabling high-availability deployment for an RDS database
    6. 10.6 Tweaking database performance
      1. 10.6.1 Increasing database resources
      2. 10.6.2 Using read replication to increase read performance
    7. 10.7 Monitoring a database
    8. Summary
  21. 11 Caching data in memory: Amazon ElastiCache and MemoryDB
    1. 11.1 Creating a cache cluster
      1. 11.1.1 Minimal CloudFormation template
      2. 11.1.2 Test the Redis cluster
    2. 11.2 Cache deployment options
      1. 11.2.1 Memcached: Cluster
      2. 11.2.2 Redis: Single-node cluster
      3. 11.2.3 Redis: Cluster with cluster mode disabled
      4. 11.2.4 Redis: Cluster with cluster mode enabled
      5. 11.2.5 MemoryDB: Redis with persistence
    3. 11.3 Controlling cache access
      1. 11.3.1 Controlling access to the configuration
      2. 11.3.2 Controlling network access
      3. 11.3.3 Controlling cluster and data access
    4. 11.4 Installing the sample application Discourse with CloudFormation
      1. 11.4.1 VPC: Network configuration
      2. 11.4.2 Cache: Security group, subnet group, cache cluster
      3. 11.4.3 Database: Security group, subnet group, database instance
      4. 11.4.4 Virtual machine: Security group, EC2 instance
      5. 11.4.5 Testing the CloudFormation template for Discourse
    5. 11.5 Monitoring a cache
      1. 11.5.1 Monitoring host-level metrics
      2. 11.5.2 Is my memory sufficient?
      3. 11.5.3 Is my Redis replication up-to-date?
    6. 11.6 Tweaking cache performance
      1. 11.6.1 Selecting the right cache node type
      2. 11.6.2 Selecting the right deployment option
      3. 11.6.3 Compressing your data
    7. Summary
  22. 12 Programming for the NoSQL database service: DynamoDB
    1. 12.1 Programming a to-do application
    2. 12.2 Creating tables
      1. 12.2.1 Users are identified by a partition key
      2. 12.2.2 Tasks are identified by a partition key and sort key
    3. 12.3 Adding data
      1. 12.3.1 Adding a user
      2. 12.3.2 Adding a task
    4. 12.4 Retrieving data
      1. 12.4.1 Getting an item by key
      2. 12.4.2 Querying items by key and filter
      3. 12.4.3 Using global secondary indexes for more flexible queries
      4. 12.4.4 Creating and querying a global secondary index
      5. 12.4.5 Scanning and filtering all of your table’s data
      6. 12.4.6 Eventually consistent data retrieval
    5. 12.5 Removing data
    6. 12.6 Modifying data
    7. 12.7 Recap primary key
      1. 12.7.1 Partition key
      2. 12.7.2 Partition key and sort key
    8. 12.8 SQL-like queries with PartiQL
    9. 12.9 DynamoDB Local
    10. 12.10 Operating DynamoDB
    11. 12.11 Scaling capacity and pricing
      1. 12.11.1 Capacity units
    12. 12.12 Networking
    13. 12.13 Comparing DynamoDB to RDS
    14. 12.14 NoSQL alternatives
    15. Summary
  23. Part 4. Architecting on AWS
  24. 13 Achieving high availability: Availability zones, autoscaling, and CloudWatch
    1. 13.1 Recovering from EC2 instance failure with CloudWatch
      1. 13.1.1 How does a CloudWatch alarm recover an EC2 instance?
    2. 13.2 Recovering from a data center outage with an Auto Scaling group
      1. 13.2.1 Availability zones: Groups of isolated data centers
      2. 13.2.2 Recovering a failed virtual machine to another availability zone with the help of autoscaling
      3. 13.2.3 Pitfall: Recovering network-attached storage
      4. 13.2.4 Pitfall: Network interface recovery
      5. 13.2.5 Insights into availability zones
    3. 13.3 Architecting for high availability
      1. 13.3.1 RTO and RPO comparison for a single EC2 instance
      2. 13.3.2 AWS services come with different high availability guarantees
    4. Summary
  25. 14 Decoupling your infrastructure: Elastic Load Balancing and Simple Queue Service
    1. 14.1 Synchronous decoupling with load balancers
      1. 14.1.1 Setting up a load balancer with virtual machines
    2. 14.2 Asynchronous decoupling with message queues
      1. 14.2.1 Turning a synchronous process into an asynchronous one
      2. 14.2.2 Architecture of the URL2PNG application
      3. 14.2.3 Setting up a message queue
      4. 14.2.4 Producing messages programmatically
      5. 14.2.5 Consuming messages programmatically
      6. 14.2.6 Limitations of messaging with SQS
    3. Summary
  26. 15 Automating deployment: CodeDeploy, CloudFormation, and Packer
    1. 15.1 In-place deployment with AWS CodeDeploy
    2. 15.2 Rolling update with AWS CloudFormation and user data
    3. 15.3 Deploying customized AMIs created by Packer
      1. 15.3.1 Tips and tricks for Packer and CloudFormation
    4. 15.4 Comparing approaches
    5. Summary
  27. 16 Designing for fault tolerance
    1. 16.1 Using redundant EC2 instances to increase availability
      1. 16.1.1 Redundancy can remove a single point of failure
      2. 16.1.2 Redundancy requires decoupling
    2. 16.2 Considerations for making your code fault tolerant
      1. 16.2.1 Let it crash, but also retry
      2. 16.2.2 Idempotent retry makes fault tolerance possible
    3. 16.3 Building a fault-tolerant web application: Imagery
      1. 16.3.1 The idempotent state machine
      2. 16.3.2 Implementing a fault-tolerant web service
      3. 16.3.3 Implementing a fault-tolerant worker to consume SQS messages
      4. 16.3.4 Deploying the application
    4. Summary
  28. 17 Scaling up and down: Autoscaling and CloudWatch
    1. 17.1 Managing a dynamic EC2 instance pool
    2. 17.2 Using metrics or schedules to trigger scaling
      1. 17.2.1 Scaling based on a schedule
      2. 17.2.2 Scaling based on CloudWatch metrics
    3. 17.3 Decoupling your dynamic EC2 instance pool
      1. 17.3.1 Scaling a dynamic EC2 instance pool synchronously decoupled by a load balancer
      2. 17.3.2 Scaling a dynamic EC2 instances pool asynchronously decoupled by a queue
    4. Summary
  29. 18 Building modern architectures for the cloud: ECS, Fargate, and App Runner
    1. 18.1 Why should you consider containers instead of virtual machines?
    2. 18.2 Comparing different options to run containers on AWS
    3. 18.3 The ECS basics: Cluster, service, task, and task definition
    4. 18.4 AWS Fargate: Running containers without managing a cluster of virtual machines
    5. 18.5 Walking through a cloud-native architecture: ECS, Fargate, and S3
    6. Summary
  30. index
  31. inside back cover
    1. AWS Services Explained in the Book

Product information

  • Title: Amazon Web Services in Action, Third Edition
  • Author(s): Michael Wittig, Andreas Wittig
  • Release date: May 2023
  • Publisher(s): Manning Publications
  • ISBN: 9781633439160