Amazon Web Services in Action
Michael Wittig and Andreas Wittig
Foreword by Ben Whaley
  • September 2015
  • ISBN 9781617292880
  • 424 pages
  • printed in black & white

A confident, practical guide through the maze of the industry’s leading cloud platform.

From the Foreword by Ben Whaley, AWS community hero and author

Amazon Web Services in Action introduces you to computing, storing, and networking in the AWS cloud. The book will teach you about the most important services on AWS. You will also learn about best practices regarding automation, security, high availability, and scalability.

Table of Contents detailed table of contents




about this book

author online

about the authors

about the cover illustration

Part 1: Getting started

1. What is Amazon Web Services?

1.1. What is cloud computing?

1.2. What can you do with AWS?

1.2.1. Hosting a web shop

1.2.2. Running a Java EE application in your private network

1.2.4. Implementing a fault-tolerant system architecture

1.3. How you can benefit from using AWS

1.3.1. Innovative and fast-growing platform

1.3.2. Services solve common problems

1.3.3. Enabling automation

1.3.4. Flexible capacity (scalability)

1.3.5. Built for failure (reliability)

1.3.6. Reducing time to market

1.3.7. Benefiting from economies of scale

1.3.8. Worldwide

1.3.9. Professional partner

1.4. How much does it cost?

1.4.1. Free Tier

1.4.2. Billing example

1.4.3. Pay-per-use opportunities

1.5. Comparing alternatives

1.6. Exploring AWS services

1.7. Interacting with AWS

1.7.1. Management Console

1.7.2. Command-line interface

1.7.3. SDKs

1.7.4. Blueprints

1.8. Creating an AWS account

1.8.1. Signing up

1.8.2. Signing In

1.8.3. Creating a key pair

1.8.4. Creating a billing alarm

1.9. Summary

2. A simple example: WordPress in five minutes

2.1. Creating your infrastructure

2.2. Exploring your infrastructure

2.2.1. Resource groups

2.2.2. Web servers

2.2.3. Load balancer

2.2.4. MySQL database

2.3. How much does it cost?

2.4. Deleting your infrastructure

2.5. Summary

Part 2: Building virtual infrastructure consisting of servers and networking

3. Using virtual servers: EC2

3.1. Exploring a virtual server

3.1.1. Launching a virtual server

3.1.2. Connecting to a virtual server

3.1.3. Installing and running software manually

3.2. Monitoring and debugging a virtual server

3.2.1. Showing logs from a virtual server

3.2.2. Monitoring the load of a virtual server

3.3. Shutting down a virtual server

3.4. Changing the size of a virtual server

3.5. Starting a virtual server in another data center

3.6. Allocating a public IP address

3.7. Adding an additional network interface to a virtual server

3.8. Optimizing costs for virtual servers

3.8.1. Reserve virtual servers

3.8.2. Bidding on unused virtual servers

3.9. Summary

4. Programming your infrastructure: the command-line interface, SDKs, and AWS CloudFormation

4.1. Infrastructure as code

4.1.1. Automation and the DevOps movement

4.1.2. Inventing an infrastructure language: JIML

4.2. Using the command-line interface

4.2.1. Installing the CLI

4.2.2. Configuring the CLI

4.2.3. Using the CLI

4.3. Programming with the SDK

4.3.1. Controlling virtual servers with SDK: nodecc

4.3.2. How nodecc creates a server

4.3.3. How nodecc lists servers and shows server details

4.3.4. How nodecc terminates a server

4.4. Using a blueprint to start a virtual server

4.4.1. Anatomy of a CloudFormation template

4.4.2. Creating your first template

4.5. Summary

5. Automating deployment: CloudFormation, Elastic Beanstalk, and OpsWorks

5.1. Deploying applications in a flexible cloud environment

5.2. Running a script on server startup using CloudFormation

5.2.1. Using user data to run a script on server startup

5.2.2. Deploying OpenSwan as a VPN server to a virtual server

5.2.3. Starting from scratch instead of updating

5.3. Deploying a simple web application with Elastic Beanstalk

5.3.1. Components of Elastic Beanstalk

5.3.2. Using Elastic Beanstalk to deploy Etherpad, a Node.js application

5.4. Deploying a multilayer application with OpsWorks

5.4.1. Components of OpsWorks

5.4.2. Using OpsWorks to deploy an IRC chat application

5.5. Comparing deployment tools

5.5.1. Classifying the deployment tools

5.5.2. Comparing the deployment services

5.6. Summary

6. Securing your system: IAM, security groups, and VPC

6.1. Who's responsible for security?

6.2. Keeping your software up to date

6.2.1. Checking for security updates

6.2.2. Installing security updates on server startup

6.2.3. Installing security updates on running servers

6.3. Securing your AWS account

6.3.1. Securing your AWS account's root user

6.3.2. Identity and Access Management service

6.3.3. Policies for authorization

6.3.4. Users for authentication, and groups to organize users

6.3.5. Roles for authentication of AWS resources

6.4. Controlling network traffic to and from your virtual server

6.4.1. Controlling traffic to virtual servers with security groups

6.4.2. Allowing ICMP traffic

6.4.3. Allowing SSH traffic

6.4.4. Allowing SSH traffic from a source IP address

6.4.5. Allowing SSH traffic from a source security group

6.4.6. Agent forwarding with PuTTY

6.5. Creating a private network in the cloud: Amazon Virtual Private Cloud (VPC)

6.5.1. Creating the VPC and an internet gateway (IGW)

6.5.2. Defining the public bastion host subnet

6.5.3. Adding the private Apache web server subnet

6.5.4. Launching servers in the subnets

6.5.5. Accessing the internet from private subnets via a NAT server

6.6. Summary

Part 3: Storing data in the cloud

7. Storing your objects: S3 and Glacier

7.1. Concept of an object store

7.2. Amazon S3

7.3. Backing up your data

7.4. Archiving objects to optimize costs

7.4.1. Creating an S3 bucket for the use with Glacier

7.4.2. Adding a lifecycle rule to a bucket

7.4.3. Experimenting with Glacier and your lifecycle rule

7.5. Storing objects programmatically

7.5.1. Setting up an S3 bucket

7.5.2. Installing a web application that uses S3

7.5.3. Reviewing code access S3 with SDK

7.6. Using S3 for static web hosting

7.6.1. Creating a bucket and uploading a static website

7.6.2. Configuring a bucket for static web hosting

7.6.3. Accessing a website hosted on S3

7.7. Internals of the object store

7.7.1. Ensuring data consistency

7.7.2. Choosing the right keys

7.8. Summary

8. Storing your data on hard drives: EBS and instance store

8.1. Network-attached storage

8.1.1. Creating an EBS volume and attaching it to your server

8.1.2. Using Elastic Block Store

8.1.3. Tweaking performance

8.1.4. Backing up your data

8.2. Instance stores

8.2.1. Using an instance store

8.2.2. Testing performance

8.2.3. Backing up your data

8.3. Comparing block-level storage solutions

8.4. Hosting a shared file system backed by an instance store and EBS

8.4.1. Security groups for NFS

8.4.2. NFS server and volume

8.4.3. NFS server installation and configuration script

8.4.4. NFS clients

8.4.5. Sharing files via NFS

8.5. Summary

9. Using a relational database service: RDS

9.1. Starting a MySQL database

9.1.1. Launching a WordPress platform with an Amazon RDS database

9.1.2. Exploring an RDS database instance with a MySQL engine

9.1.3. Pricing for Amazon RDS

9.2. Importing data into a database

9.3. Backing up and restoring your database

9.3.1. Configuring automated snapshots

9.3.2. Creating snapshots manually

9.3.3. Restoring a database

9.3.4. Copying a database to another region

9.3.5. Calculating the cost of snapshots

9.4. Controlling access to a database

9.4.1. Controlling access to the configuration of an RDS database

9.4.2. Controlling network access to an RDS database

9.4.3. Controlling data access

9.5. Relying on a highly available database

9.5.1. Enabling high-availability deployment for an RDS database

9.6. Tweaking database performance

9.6.1. Increasing database resources

9.6.2. Using read replication to increase read performance

9.7. Monitoring a database

9.8. Summary

10. Programming for the NoSQL database service: DynamoDB

10.1. Operating DynamoDB

10.1.1. Administration

10.1.2. Pricing

10.1.3. RDS comparison

10.2. DynamoDB for developers

10.2.1. Tables, items, and attributes

10.2.2. Primary keys

10.2.3. NoSQL comparison

10.2.4. DynamoDB Local

10.3. Programming a to-do application

10.4. Creating tables

10.4.1. Users with hash keys

10.4.2. Tasks with hash and range keys

10.5. Adding data

10.5.1. Adding a user

10.5.2. Adding a task

10.6. Retrieving data

10.6.1. Getting by key

10.6.2. Querying by key and filter

10.6.3. Using secondary indexes for more flexible queries

10.6.4. Scanning and filtering all of your table's data

10.6.5. Eventually consistent data retrieval

10.7. Removing data

10.8. Modifying data

10.9. Scaling capacity

10.10. Summary

Part 4: Architecting on AWS

11. Achieving high availability: availability zones, auto-scaling, and CloudWatch

11.1. Recovering from server failure with CloudWatch

11.1.1. Creating a CloudWatch alarm

11.1.2. Monitoring and recovering a virtual server based on a CloudWatch alarm

11.2. Recovering from a data center outage

11.2.1. Availability zones: multiple data centers per region

11.2.2. Using auto-scaling to ensure that a virtual server is always running

11.2.3. Recovering a failed virtual server to another availability zone with the help of auto-scaling

11.2.4. Pitfall: network-attached storage recovery

11.2.5. Pitfall: network interface recovery

11.3. Analyzing disaster-recovery requirements

11.3.1. RTO and RPO comparison for a single virtual server

11.4. Summary

12. Decoupling your infrastructure: ELB and SQS

12.1. Synchronous decoupling with load balancers

12.1.1. Setting up a load balancer with virtual servers

12.1.2. Pitfall: connecting a server too early

12.1.3. More use cases

12.2. Asynchronous decoupling with message queues

12.2.1. Turning a synchronous process into an asynchronous one

12.2.2. Architecture of the URL2PNG application

12.2.3. Setting up a message queue

12.2.4. Producing messages programmatically

12.2.5. Consuming messages programmatically

12.2.6. Limitations of messaging with SQS

12.3. Summary

13. Designing for fault-tolerance

13.1. Using redundant EC2 instances to increase availability

13.1.1. Redundancy can remove a single point of failure

13.1.2. Redundancy requires decoupling

13.2. Considerations for making your code fault-tolerant

13.2.1. Let it crash, but also retry

13.2.2. Idempotent retry makes fault-tolerance possible

13.3. Architecting a fault-tolerant web application: Imagery

13.3.1. The idempotent image-state machine

13.3.2. Implementing a fault-tolerant web service

13.3.3. Implementing a fault-tolerant worker to consume SQS messages

13.3.4. Deploying the application

13.4. Summary

14. Scaling up and down: auto-scaling and CloudWatch

14.1. Managing a dynamic server pool

14.2. Using metrics and schedules to trigger scaling

14.2.1. Scaling based on a schedule

14.2.2. Scaling based on CloudWatch metrics

14.3. Decouple your dynamic server pool

14.3.1. Scaling a dynamic server pool synchronously decoupled by a load balancer

14.3.2. Scaling a dynamic server pool asynchronously decoupled by a queue

14.4. Summary

About the Technology

Physical data centers require lots of equipment and take time and resources to manage. If you need a data center, but don’t want to build your own, Amazon Web Services may be your solution. Whether you’re analyzing real-time data, building software as a service, or running an e-commerce site, AWS offers you a reliable cloud-based platform with services that scale.

About the book

Amazon Web Services in Action introduces you to computing, storing, and networking in the AWS cloud. The book will teach you about the most important services on AWS. You will also learn about best practices regarding security, high availability and scalability.You'll start with a broad overview of cloud computing and AWS and learn how to spin-up servers manually and from the command line. You'll learn how to automate your infrastructure by programmatically calling the AWS API to control every part of AWS. You will be introduced to the concept of Infrastructure as Code with the help of AWS CloudFormation.You will learn about different approaches to deploy applications on AWS. You'll also learn how to secure your infrastructure by isolating networks, controlling traffic and managing access to AWS resources. Next, you'll learn options and techniques for storing your data. You will experience how to integrate AWS services into your own applications by the use of SDKs. Finally, this book teaches you how to design for high availability, fault tolerance, and scalability.

What's inside

  • Overview of AWS cloud concepts and best practices
  • Manage servers on EC2 for cost-effectiveness
  • Infrastructure automation with Infrastructure as Code (AWS CloudFormation)
  • Deploy applications on AWS
  • Store data on AWS: SQL, NoSQL, object storage and block storage
  • Integrate Amazon's pre-built services
  • Architect highly available and fault tolerant systems

About the reader

Written for developers and DevOps engineers moving distributed applications to the AWS platform.

About the authors

Andreas Wittig and Michael Wittig are software engineers and consultants focused on AWS and web development.

  • combo $49.99 pBook + eBook
  • eBook $39.99 pdf + ePub + kindle

FREE domestic shipping on three or more pBooks

Fantastic introduction to cloud basics with excellent real-world examples.

Rambabu Posa, GL Assessment

A very thorough and practical guide to everything AWS ... highly recommended.

Scott M. King, Amazon

Cuts through the vast expanse of official documentation and gives you what you need to make AWS work now!

Carm Vecchio, Computer Science Corporation (CSC)