Nick Alteen | Jennifer Fisher | Casey Gerena |
Wes Gruver | Asim Jalis | Heiwad Osman |
Marife Pagan | Santosh Patlolla | Michael Roth |
Copyright © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Published by John Wiley & Sons, Inc., Indianapolis, Indiana.
Published simultaneously in Canada
ISBN: 978-1-119-50819-9
ISBN: 978-1-119-50821-2 (ebk.)
ISBN: 978-1-119-50820-5 (ebk.)
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750–8400, fax (978)
646–8600. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748–6011, fax (201) 748–6008, or online at http://www.wiley.com/go/permissions.
Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warranties with respect to the accuracy or completeness of the contents of this work and specifically disclaim all warranties, including without limitation warranties of fitness for a particular purpose. No warranty may be created or extended by sales or promotional materials. The advice and strategies contained herein may not be suitable for every situation. This work is sold with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional services. If professional assistance is required, the services of a competent professional person should be sought. Neither the publisher nor the author shall be liable for damages arising herefrom. The fact that an organization or website is referred to in this work as a citation and/or a potential source of further information does not mean that the author or the publisher endorses the information the organization or website may provide or recommendations it may make. Further, readers should be aware that Internet website listed in this work may have changed or disappeared between when this work was written and when it is read.
For general information on our other products and services or to obtain technical support, please contact our Customer Care Department within the U.S. at (877) 762–2974, outside the U.S. at (317) 572–3993 or fax (317) 572–4002.
Wiley publishes in a variety of print and electronic formats and by print-on-demand. Some material included with standard print versions of this book may not be included in e-books or in print-on-demand. If this book refers to media such as a CD or DVD that is not included in the version you purchased, you may download this material at http://booksupport.wiley.com. For more information about Wiley products, visit www.wiley.com.
Library of Congress Control Number: 2019943088
TRADEMARKS: Wiley, the Wiley logo, and the Sybex logo are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates, in the United States and other countries, and may not be used without written permission. AWS is a registered trademark of Amazon Technologies, Inc. All other trademarks are the property of their respective owners. John Wiley & Sons, Inc. is not associated with any product or vendor mentioned in this book.
Nick Alteen, technical training architect, Amazon Web Services
Nick specializes in designing and building training labs that educate the U.S. intelligence community on AWS best practices and design patterns. Before this, Nick worked as a cloud support engineer, assisting customers in resolving any number of issues related to AWS DevOps services, with a specific focus on configuration management and infrastructure as code. In his free time, he enjoys building LEGO models with his daughter and watching horror movies with his wife.
Jennifer Fisher, senior technical curriculum developer, Amazon Web Services
Jennifer started at AWS in 2014 as a technical trainer and was the lead instructor for Big Data on AWS. She holds multiple AWS certifications and currently leads a curriculum development team and develops technical curriculum and labs to support public sector customers. Before that, Jennifer spent 20 years as a software and data engineer in the financial services, defense, and healthcare industries. She holds a BS in programming and an MS in software engineering management.
Jennifer grew up on a farm in Northern Maine and bought her first computer, a Tandy TRS-80, with her potato-picking money at the age of 12. She began writing basic programs and role-playing games, not realizing at the time that her passion for coding would turn into a lifelong career. She now mentors female engineers and volunteers for K-12 students in STEM.
Jennifer is based in Herndon, Virginia, and lives with her husband Steve. She is a doting stepmother to Kate, Sophie, and Mason. In her free time, Jennifer enjoys hiking, geocaching, kayaking, mountain biking, weight lifting, and competing in obstacle course races.
Casey Gerena, senior technical trainer, Amazon Web Services
Casey is passionate about helping others learn about the AWS Cloud. He enjoys teaching others new technical skills to help them solve problems using serverless technologies such as AWS Lambda. Casey holds a BS in management information systems from the University of Central Florida and an MS in logistics and global supply chain management from Embry-Riddle Aeronautical University. He is pursuing a second master’s degree in computer science from the Georgia Institute of Technology. Casey holds several IT certifications, including the Certified Information Systems Security Professional (CISSP) and nine AWS certifications. Before joining Amazon, Casey was a software developer and cybersecurity consultant. In his free time, Casey enjoys spending time with his family, watching movies, playing video games, and running.
Wes Gruver, senior technical trainer, Amazon Web Services
Wes has been with AWS since 2015 and is a senior technical trainer with more than 20 years of experience and success in managing IT infrastructure and all aspects of application development and management. He is currently responsible for training AWS enterprise customers on how to use the AWS services best suited for their business and IT solutions. He teaches a broad range of classes, including basic to advanced architecture, DevOps on AWS, Big Data on AWS, and security operations. In his free time, Wes teaches scuba diving and loves to travel.
Asim Jalis, senior technical trainer, Amazon Web Services
Asim is a senior technical trainer at AWS. He has an MS in computer science from the University of Virginia and an MA in mathematics from the University of Wisconsin. When he is not working with AWS technologies, he likes to read and write fiction.
Heiwad Osman, senior manager, Solutions Builders, Amazon Web Services
Heiwad holds a BS in computer science and engineering from UCLA. In his role as an AWS trainer, he meets with AWS customers and teaches them to build resilient, scalable cloud applications. He has helped hundreds of software developers get started with AWS APIs through in-person training and online training videos. His current professional interests include user experience, web application development, and machine learning. In his free time, you can find him in New York City, trying new places to eat or relaxing in Central Park.
Marife Pagan, technical trainer, Amazon Web Services
Marife is a technical trainer for AWS, delivering training to AWS customers in North America. She has more than 15 years of experience in software and web development. Her experience brings a set of skills for multiple platforms, including .NET, Java, and Python. She holds a BS in information technology with a web design/development concentration from George Mason University, in addition to various leading industry certifications. She is currently working on her master’s degree and pursuing higher studies in machine learning.
Before working at AWS, Marife worked for various government contracting firms, including Lockheed Martin. She also serves in the U.S. military as a signal officer working on the setup and maintenance of LAN and WAN signal network footprints, supporting voice and data for various military operations. She currently lives in the Washington, DC, metro area, and in her spare time enjoys fitness, travel, and gardening.
Santosh Patlolla, technical curriculum architect, Amazon Web Services
Santosh is a technical curriculum architect for AWS. He has more than 18 years of experience in developing software applications, automated solutions, and migration projects with complex data conversions. Santosh has been instrumental in providing production-support solutions and managing application delivery programs for enterprises. He also designed cost-effective technical and business solutions for the banking and insurance industries. Santosh is passionate about applying this experience in using the broad range of AWS services for developing business automations. Outside of work, he coaches elementary school robotics, and enjoys watching basketball games and playing with his kids.
Michael Roth, technical trainer, Amazon Web Services
Michael is a technical trainer having joined Amazon in 2015. He is one of the authors of the SysOps Administrator Study Guide (also by Wiley). He is a Certified Cisco Network Academy Instructor, and he has taught Linux. Michael graduated from the University of Michigan with a BS in zoology and a BA in urban planning. He also has an MS in telecommunications management from Golden Gate University. Michael would like to thank his coworkers in the AWS Training and Certification organization—he is very proud to be a part of this amazing group of people. Finally, he would like to thank his spouse, Betsy, and son, Robert. Without their support and love, this book would not have been possible.
Exercise 1.1 Sign Up for an Account
Exercise 1.2 Create an IAM Administrators Group and User
Exercise 1.3 Install and Configure the AWS CLI
Exercise 1.4 Download the Code Samples
Exercise 1.5 Run a Python Script that Makes AWS API Calls
Exercise 1.6 Working with Multiple Regions
Exercise 1.7 Working with Additional Profiles
Exercise 2.1 Create an Amazon EC2 Key Pair
Exercise 2.2 Create an Amazon VPC with Public and Private Subnets
Exercise 2.3 Use an IAM Role for API Calls from Amazon EC2 Instances
Exercise 2.4 Launch an Amazon EC2 Instance as a Web Server
Exercise 2.5 Connect to the Amazon EC2 Instance
Exercise 2.6 Configure NAT for Instances in the Private Subnet
Exercise 2.7 Launch an Amazon EC2 Instance into the Private Subnet
Exercise 2.8 Make Requests to Private Instance
Exercise 2.9 Launch an AWS Cloud9 Instance
Exercise 2.10 Perform Partial Cleanup
Exercise 2.11 (Optional) Complete Cleanup
Exercise 3.1 Create an Amazon Simple Storage Service (Amazon S3) Bucket
Exercise 3.2 Upload an Object to a Bucket
Exercise 3.3 Emptying and Deleting a Bucket
Exercise 4.1 Create a Security Group for the Database Tier on Amazon RDS
Exercise 4.2 Spin Up the MariaDB Database Instance
Exercise 4.3 Obtain the Endpoint Value for the Amazon RDS Instance
Exercise 4.4 Create a SQL Table and Add Records to It
Exercise 4.5 Query the Items in the SQL Table
Exercise 4.6 Remove Amazon RDS Database and Security Group
Exercise 4.7 Create an Amazon DynamoDB Table
Exercise 4.8 Add Users to the Amazon DynamoDB Table
Exercise 4.9 Look Up a User in the Amazon DynamoDB Table
Exercise 4.10 Write Data to the Table as a Batch Process
Exercise 4.11 Scan the Amazon DynamoDB Table
Exercise 4.12 Remove the Amazon DynamoDB Table
Exercise 5.1 Configure an Amazon S3 Bucket to Deny Unencrypted Uploads
Exercise 5.2 Create and Disable an AWS Key Management Service (AWS KMS) Key
Exercise 5.3 Create an AWS KMS Customer Master Key with the Python SDK
Exercise 6.1 Deploy Your Application
Exercise 6.2 Deploy a Blue/Green Solution
Exercise 6.3 Change Your Environment Configuration on AWS Elastic Beanstalk
Exercise 6.4 Update an Application Version on AWS Elastic Beanstalk
Exercise 7.1 Create an AWS CodeCommit Repository and Submit a Pull Request
Exercise 7.2 Create an Application in AWS CodeDeploy
Exercise 7.3 Create an AWS CodeBuild Project
Exercise 8.1 Write Your Own AWS CloudFormation Template
Exercise 8.2 Troubleshoot a Failed Stack Deletion
Exercise 8.3 Monitor Stack Update Activity
Exercise 9.1 Launch a Sample AWS OpsWorks Stacks Environment
Exercise 9.2 Launch an Amazon ECS Cluster and Containers
Exercise 9.3 Migrate an Amazon RDS Database
Exercise 9.4 Configure Auto Healing Event Notifications in AWS OpsWorks Stacks
Exercise 10.1 Setting Up a Simple Active Directory
Exercise 10.2 Setting Up an AWS Managed Microsoft AD
Exercise 10.3 Setting Up an Amazon Cloud Directory
Exercise 10.4 Setting Up Amazon Cognito
Exercise 11.1 Create an Amazon SQS Queue, Add Messages, and Receive Messages
Exercise 11.2 Send an SMS Text Message to Your Mobile Phone with Amazon SNS
Exercise 11.3 Create an Amazon Kinesis Data Stream and Write/Read Data
Exercise 11.4 Create an AWS Step Functions State Machine 1
Exercise 11.5 Create an AWS Step Functions State Machine 2
Exercise 12.1 Create an Amazon S3 Bucket for CSV Ingestion
Exercise 12.2 Create an Amazon S3 Bucket for Final Output JSON
Exercise 12.3 Verify List Buckets
Exercise 12.4 Prepare the AWS Lambda Function
Exercise 12.5 Create AWS IAM Roles
Exercise 12.6 Create the AWS Lambda Function
Exercise 12.7 Give Amazon S3 Permission to Invoke an AWS Lambda Function
Exercise 12.8 Add the Amazon S3 Event Trigger
Exercise 12.9 Test the AWS Lambda Function
Exercise 13.1 Create an Amazon S3 Bucket for the Swagger Template
Exercise 13.2 Edit the HTML Files
Exercise 13.3 Define an AWS SAM Template
Exercise 13.4 Define an AWS Lambda Function Locally
Exercise 13.5 Generate an Event Source
Exercise 13.6 Run the AWS Lambda Function
Exercise 13.7 Modify the AWS SAM template to Include an API Locally
Exercise 13.8 Modify Your AWS Lambda Function for the API
Exercise 13.9 Run Amazon API Gateway Locally
Exercise 14.1 Create an Amazon ElastiCache Cluster Running Memcached
Exercise 14.2 Expand the Size of a Memcached Cluster
Exercise 14.3 Create and Attach an Amazon EFS Volume
Exercise 14.4 Create and Upload to an Amazon S3 Bucket
Exercise 14.5 Create an Amazon DynamoDB Table
Exercise 14.6 Enable Amazon S3 Versioning
Exercise 14.7 Create an Amazon DynamoDB Global Table
Exercise 14.8 Enable Cross-Region Replication
Exercise 14.9 Create an Amazon DynamoDB Backup Table
Exercise 14.10 Restoring an Amazon DynamoDB Table from a Backup
Exercise 15.1 Create an Amazon CloudWatch Alarm on an Amazon S3 Bucket
Exercise 15.2 Enable an AWS CloudTrail Trail on an Amazon S3 Bucket
Exercise 15.3 Create an Amazon CloudWatch Dashboard
Exercise 16.1 Set Up a CPU Usage Alarm Using AWS CLI
Exercise 16.2 Modify Amazon EBS Optimization for a Running Instance
Exercise 16.3 Create an AWS Config Rule
Exercise 16.4 Create a Launch Configuration and an AWS Auto Scaling Group, and Schedule a Scaling Action
Software development is changing. In today’s competitive market, customers demand low-latency, highly scalable, responsive applications that work—all the time. Customers expect to receive the same level of performance and consistency of applications regardless of their device. Whether they are on a mobile device, desktop, laptop, or Amazon Fire tablet, they expect that applications will behave similarly across platforms.
The goal of building working applications that respond to increasing expectations means that building applications on highly available architecture is now more important than ever. As developers, you can use AWS Cloud computing to build highly available architectures and services on which to deploy and run your applications.
AWS provides you with a broad set of tools to build and develop your applications. We empower you by providing the best tools to achieve your goals. To that end, you’ll learn about compute services, such as Amazon Elastic Compute Cloud (Amazon EC2), and file object storage services, such as Amazon Simple Storage Service (Amazon S3). You’ll also learn about the many types of applications that you can build on top of these services.
Historically, developers have been responsible for designing, creating, and running their applications. In the AWS Cloud, you can create your compute resources with one click using AWS CloudFormation, or you can fully automate the running of your containers using AWS Fargate.
AWS continually listens to customer feedback to understand your workloads and changing needs better. AWS also monitors market trends, understanding that you want to build and run applications on the cloud, but you don’t want to worry about managing the underlying infrastructure. You want infrastructure to scale automatically, you want services with a built-in high availability infrastructure, and you want to pay only for what you consume.
In response to these demands, AWS pioneered services such as AWS Lambda, which is based on serverless technology. It enables you to run compute programming logic in applications without having to worry about maintaining anything other than their code and core logic.
Today is the most exciting time to be a developer. With AWS services, you can focus on the core functionality of your application and allow the AWS Cloud to perform all of the administration of the resources, including server and operating system maintenance. This flexibility provides you with the unique ability to focus on what matters to you most—building, maintaining, and, most importantly, innovating your applications.
In this study guide, AWS experts coach you on how to develop and build applications that can run on and integrate with AWS services. This knowledge allows you, as a developer, to build your services and features quickly and get them running in the AWS Cloud for your customers to use. When you complete this guide and the test bank in the accompanying interactive online learning environment, you have gained the fundamental knowledge to succeed on the AWS Certified Developer – Associate certification exam.
So imagine, dream, and build, because on the AWS Cloud, the only limit is your imagination.
Werner Vogels
Vice President and Corporate Technology Officer
Amazon
Developers are builders. They are responsible for imagining, designing, and building applications. This study guide is designed to help you develop, build, and create solutions by using AWS services and to provide you with the knowledge required to obtain the AWS Certified Developer – Associate certification.
The study guide covers relevant topics on the exam, with additional context to increase your understanding of how to build applications on AWS. This study guide references the exam blueprint throughout all of its chapters and content to provide a comprehensive view of the required knowledge to pass the exam. Furthermore, this study guide was designed to help you understand the key concepts required to earn the certification and for you to use as a reference for building highly available applications that run on the AWS Cloud. However, the study guide does not cover any prerequisite knowledge concerning software development; that is, the study guide does not cover how to program in Java, Python, .NET, and other platform languages. Instead, you will use these languages to build, manage, and deploy your resources on AWS.
The study guide begins with an introduction to the AWS Cloud and how you can interact with the AWS Cloud by using API calls. API calls are the heart of the AWS Cloud, as every interaction with AWS is an API call to the service. As such, the initial chapter provides you with the core knowledge on which the rest of the chapters are built. Because security is a top priority for all applications, the first chapter also describes how to create your API keys by using AWS Identity and Access Management (IAM). The rest of the chapters cover topics ranging from compute services, storage services, databases, encryption, and serverless-based applications.
The chapters were designed with the understanding that developers build. To enhance learning through hands-on experience, at the end of each chapter is an “Exercises” section with activities that help reinforce the main topic of the chapter. Each chapter also contains a “Review Questions” section to assess your understanding of the main concepts required to work with AWS. However, understand that the actual exam will test you on your ability to combine multiple concepts. The review questions at the end of each chapter focus only on the topics discussed in that chapter.
To help you determine the level of your AWS Cloud knowledge and aptitude before reading the guide, an assessment test with 50 questions is provided at the end of this introduction. Two practice exams with 75–100 questions each are also included to help you gauge your readiness to take the exam.
This book covers topics that you need to know to prepare for the Amazon Web Services (AWS) Certified Developer – Associate Exam.
Chapter 1: Introduction to AWS Cloud API This chapter provides an overview of how to use AWS Cloud API calls. The chapter includes an introduction to AWS software development kits (AWS SDKs) and the AWS global infrastructure. A review of AWS API keys and how to manage them using AWS Identity and Access Management (IAM) is also included.
Chapter 2: Introduction to Compute and Networking This chapter reviews compute and networking environments in AWS. It provides an overview of resources, such as Amazon Elastice Compute Cloud (Amazon EC2), and the network controls exposed through Amazon Virtual Private Cloud (Amazon VPC).
Chapter 3: Hello, Storage In this chapter, you will learn about cloud storage with AWS. It provides a review of storage fundamentals and the AWS storage portfolio of services, such as Amazon Simple Storage Service (Amazon S3) and Amazon S3 Glacier. The chapter also covers how to choose the right type of storage for a workload.
Chapter 4: Hello, Databases This chapter provides an overview of the AWS database services. The chapter provides a baseline understanding of SQL versus NoSQL. It also introduces concepts such as caching with Amazon ElastiCache and business intelligence with Amazon Redshift. The chapter also covers Amazon Relational Database Service (Amazon RDS) and Amazon DynamoDB.
Chapter 5: Encryption on AWS In this chapter, you will explore AWS services that enable you to perform encryption of data at rest using both customer and AWS managed solutions. An overview of each approach and the use case for each is provided. Example architectures are included that show the differences between a customer and an AWS managed infrastructure.
Chapter 6: Deployment Strategies In this chapter, you will learn about automated application deployment, management, and maintenance by using AWS Elastic Beanstalk. You will also learn about the various deployment methodologies and options to determine the best approach for individual workloads.
Chapter 7: Deployment as Code This chapter describes the AWS code services used to automate infrastructure and application deployments across AWS and on-premises resources. You will learn about the differences among continuous integration, continuous delivery, and continuous deployment, in addition to how AWS enables you to achieve each.
Chapter 8: Infrastructure as Code This chapter focuses on AWS CloudFormation and how you can use the service to create flexible, repeatable templates for a cloud infrastructure. You will learn about the different AWS CloudFormation template components, supported resources, and how to integrate non-AWS resources into your templates using custom resources.
Chapter 9: Configuration as Code In this chapter, you will learn about AWS OpsWorks Stacks and Amazon Elastic Container Service (Amazon ECS). OpsWorks Stacks enables you to perform automated configuration management on resources in your AWS account and on-premises instances using Chef cookbooks. You will learn how to add a Chef cookbook to your stack, associate it with an instance, and perform configuration changes. Using Amazon ECS, you will learn how to create clusters and services and how to deploy tasks to your cluster in response to changes in customer demand.
Chapter 10: Authentication and Authorization This chapter explains the differences between authentication and authorization and how these differences apply to infrastructure and applications running on AWS. You will also learn about integrating third-party identity services, in addition to the differences between the control pane and data pane.
Chapter 11: Refactor to Microservices In this chapter, you will learn about microservices and how to refactor large application stacks into small, portable containers. You will also learn how to implement messaging infrastructure to enable communication between microservices running in your environment.
Chapter 12: Serverless Compute This chapter reviews AWS Lambda as a compute service that you can use to run code without provisioning or managing servers. In this chapter, you will learn about creating, triggering, and securing Lambda functions. You will also learn other features of Lambda, such as versioning and aliases.
Chapter 13: Serverless Applications This chapter expands on the serverless concepts you learned in Chapter 12, “Serverless Compute,” and shows you how to architect a full-stack serverless web application. You will learn how to map server-based application architectures to serverless application architectures.
Chapter 14: Stateless Application Patterns This chapter expands on the concepts you learned in Chapter 13, “Serverless Applications,” by explaining how to design stateless applications. You will learn how to develop applications that do not depend on state information stored on individual resources, allowing for additional portability and availability.
Chapter 15: Monitoring and Troubleshooting This chapter discusses AWS services that you can use to monitor the health of your applications, in addition to changes to AWS resources over time. You will learn how to use Amazon CloudWatch to perform log analysis and create custom metrics for ingestion by other tools and for creating visualizations in the dashboard. You will also learn how to use AWS CloudTrail to monitor API activity for your AWS account to ensure that changes are appropriately audited over time. You will also learn how to use AWS X-Ray to create visual maps of application components for step-by-step analysis.
Chapter 16: Optimization This chapter covers some of the best practices and considerations for designing systems to achieve business outcomes at a minimal cost and to maintain optimal performance efficiency. This chapter covers scenarios for compute and storage, how to use a serverless platform, and what to consider for efficient data transfer to optimize your solutions. The chapter describes key AWS tools for managing and monitoring the cost and performance of your infrastructure. It includes code snippets, samples, and exercises to develop monitoring solutions and designs that integrate other AWS services.
The authors have worked hard to provide you with some great tools to help you with your certification process. The interactive online learning environment that accompanies the AWS Certified Developer – Associate Official Study Guide provides a test bank with study tools to help you prepare for the certification exam. This helps you increase your chances of passing it the first time! The test bank includes the following:
Sample Tests All of the questions in this book, including the 50-question assessment test at the end of this introduction and the review questions that are provided at the end of each chapter are available online. In addition, there are two practice exams available online with 75–100 questions each. Use these questions to test your knowledge of the study guide material. The online test bank runs on multiple devices.
Flashcards The online test banks include more than 200 flashcards specifically written to quiz your knowledge of AWS operations. After completing all the exercises, review questions, practice exams, and flashcards, you should be more than ready to take the exam. The flashcard questions are provided in a digital flashcard format (a question followed by a single correct answer). You can use the flashcards to reinforce your learning and provide last-minute test prep before the exam.
Glossary A glossary of key terms from this book is available as a fully searchable PDF.
Go to www.wiley.com/go/sybextestprep to register and gain access to this interactive online learning environment and test bank with study tools.
The AWS Certified Developer – Associate Exam is intended for individuals who perform in a developer role. Exam concepts that you should understand for this exam include the following:
In general, certification candidates should understand the following:
The exam covers five different domains, with each domain broken down into objectives and subobjectives.