Amazon Web Services for Mobile Developers - Abhishek Mishra - E-Book

Amazon Web Services for Mobile Developers E-Book

Abhishek Mishra

0,0
35,99 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.
Mehr erfahren.
Beschreibung

A practical, real-world introduction to AWS tools and concepts Amazon Web Services for Mobile Developers: Building Apps with AWS presents a professional view of cloud computing and AWS for experienced iOS/Android developers and technical/solution architects. Cloud computing is a rapidly expanding ecosystem, and working professionals need a practical resource to bring them up-to-date on tools that are rapidly becoming indispensable; this book helps expand your skill set by introducing you to AWS offerings that can make your job easier, with a focus on real-world application. Author and mobile applications developer Abhishek Mishra shows you how to create IAM accounts and try out some of the most popular services, including EC2, Lambda, Mobile Analytics, Device Farm, and more. You'll build a chat application in both Swift (iOS) and Java (Andoid), running completely off AWS Infrastructure to explore SDK installation, Xcode, Cognito authentication, DynamoDB, Amazon SNA Notifications, and other useful tools. By actually using the tools as you learn about them, you develop a more intuitive understanding that feels less like a shift and more like a streamlined integration. If you have prior experience with Swift or Java and a solid knowledge of web services, this book can help you quickly take your skills to the next level with a practical approach to learning that translates easily into real-world use. * Understand the key concepts of AWS as applied to both iOS and Android developers * Explore major AWS offerings for mobile developers, including DynamoDB, RDS, EC2, SNS, Cognito, and more * Learn what people are talking about when they use buzzwords like PaaS, IaaS, SaaS, and APaaS * Work through explanations by building apps that tie into the AWS ecosystem Any job is easier with the right tools, and Amazon Web Services for Mobile Developers: Building Apps with AWS gets you acquainted with an ever-expanding toolkit for mobile app development.

Sie lesen das E-Book in den Legimi-Apps auf:

Android
iOS
von Legimi
zertifizierten E-Readern

Seitenzahl: 600

Veröffentlichungsjahr: 2017

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



AmazonWeb Services forMobile Developers

Building Apps with AWS®

Abhishek Mishra

Senior Acquisitions Editor: Kenyon Brown

Development Editor: Tom Dinse

Technical Editors: Chaim Krause and John Mueller

Production Editor: Christine O’Connor

Copy Editor: Karen Davis

Editorial Manager: Mary Beth Wakefield

Production Manager: Kathleen Wisor

Associate Publisher: Jim Minatel

Book Designers: Judy Fung and Bill Gibson

Proofreader: Nancy Carrasco

Indexer: Ted Laux

Project Coordinator, Cover: Brent Savage

Cover Designer: Wiley

Cover Image: Jeremy Woodhouse / Getty Images

Copyright © 2018 by John Wiley & Sons, Inc., Indianapolis, Indiana

Published simultaneously in Canada

ISBN: 978-1-119-37785-6

ISBN: 978-1-119-37784-9 (ebk.)

ISBN: 978-1-119-37786-3 (ebk.)

Manufactured in the United States of America

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 Web site 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 Web site may provide or recommendations it may make. Further, readers should be aware that Internet Web sites 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: 2017956046

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. Amazon Web Services and AWS are trademarks or registered trademarks 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.

To my wife, Sonam, for her love and support through all the years we’ve been together.

To my daughter, Elana, for bringing joy and happiness into our lives.

Acknowledgments

This book would not have been possible without the support of the team at Wiley, including Jim Minatel, Kenyon Brown, Tom Dinse, and Karen Davis.

I would also like to thank Chaim Krause for taking the time to read the entire manuscript and for his keen eye for detail.

It has been my privilege to work with you. Thank you.

About the Authors

Abhishek Mishra has been active in the IT industry for more than 19 years. He has extensive experience with a wide range of programming languages, enterprise systems, and platforms.

He holds a master’s degree in computer science from the University of London and currently provides consultancy services to Barclays Bank PLC in London as a solutions architect.

Abhishek is the author of iOS Code Testing, iPhone and iPad App: 24-Hour Trainer, and Swift iOS: 24-Hour Trainer. He is the technical reviewer of Professional iOS Programming.

About the Technical Editor

Chaim Krause is a simulation specialist for the U.S. Army in Leavenworth, Kansas. Although he holds a bachelor’s in political science from the University of Chicago, Chaim is an autodidact when it comes to computers, programming, and electronics. He wrote his first computer game in BASIC on a Tandy Model I Level I and stored the program on a cassette tape. Amateur radio introduced him to electronics, while the Arduino and the Raspberry Pi provided a medium to combine computing, programming, and electronics into one hobby.

In his spare time, Chaim likes to play PC games and occasionally develops his own. He has recently taken up the sport of golf to spend more time with his significant other, Ivana.

Contents

Acknowledgments

About the Authors

About the Technical Editor

Introduction

Who This Book Is For

What This Book Covers

How This Book Is Structured

What You Need to Use This Book

Conventions

Source Code

PART I Introduction to Amazon Web Services

Chapter 1 Introduction to Cloud Computing and Amazon Web Services

What Is Cloud Computing?

Cloud Service Models

Cloud Deployment Models

The AWS Ecosystem

Sign Up for an AWS Free Tier Account

Summary

Chapter 2 Regions, Availability Zones, and Edge Locations

Regions and Availability Zones

Edge Locations

Accessing AWS

Summary

Chapter 3 AWS Identity and Access Management

Key Concepts

Common Tasks

Summary

Chapter 4 Amazon EC2

Key Concepts

Common Tasks

Accessing Amazon EC2 Instances Using the AWS CLI

Summary

Chapter 5 Amazon S3

Key Concepts

Common Tasks

Summary

Chapter 6 Amazon DynamoDB

Key Concepts

Common Tasks

Summary

Chapter 7 AWS Lambda

Common Use Cases for AWS Lambda

Key Concepts

Common Tasks

Summary

PART II AWS for iOS Developers

Chapter 8 Integrating the AWS SDK for iOS

Integrating the AWS SDK for iOS Using CocoaPods

Integrating the AWS SDK for iOS Using Carthage

Integrating the AWS SDK for iOS Using Dynamic Frameworks

Summary

Chapter 9 Implementing User Signup and Login Using Amazon Cognito User Pools

Introducing Amazon Cognito User Pools

Examining the AWSChat Xcode Project

Creating an Amazon Cognito User Pool

Retrieving the App Client Secret

Updating the AWS Chat Application

Summary

Chapter 10 Implementing Login Using Facebook

Creating an App on Facebook

Adding the Facebook SDK to the Xcode Project

Creating an Amazon Cognito Identity Pool

Updating the Application User Interface

Summary

Chapter 11 Implementing Login Using Google

Adding the Google SDK to the Xcode Project

Updating the Identity Pool

Updating the AWSChat Application

Summary

Chapter 12 Accessing Amazon DynamoDB

Creating Amazon DynamoDB Tables

Populating the User Table with an AWS Lambda Function

Testing the AWS Lambda Function

Updating the AWSChat App

Summary

Chapter 13 Adding AWSChat Support with Amazon DynamoDB and Amazon S3

Updating the DynamoDBController Class

Configuring Amazon S3

Creating the S3Controller Class

Updating the ChatManager Class

Updating the User Interface of the App

Summary

Chapter 14 Using AWS Lambda to Generate Thumbnails

Creating a Node.JS Lambda Function Deployment Package

Creating an AWS Lambda Function Using the AWS Management Console

Testing the AWS Lambda Function

Updating the S3Controller Class

Updating the ChatManager Class

Updating the User Interface of the App

Summary

PART III AWS for Android Developers

Chapter 15 Integrating the AWS SDK for Android with Android Studio

Integrating the AWS SDK for Android Using Gradle

Integrating the AWS SDK for Android by Importing JAR Files

Summary

Chapter 16 Implementing User Signup and Login Using Amazon Cognito User Pools

Introducing Amazon Cognito User Pools

Examining the AWSChat Android Studio Project

Creating an Amazon Cognito User Pool

Retrieving the App Client Secret

Updating the AWS Chat Application

Summary

Chapter 17 Implementing Login Using Facebook

Creating an App on Facebook

Adding the Facebook SDK to the Android Studio Project

Creating an Amazon Cognito Identity Pool

Updating the Application User Interface

Summary

Chapter 18 Implementing Login Using Google

Installing the Google Play Services SDK

Creating an App on the Google Developer Console

Updating the Android Studio Project

Updating the Identity Pool

Updating the Identity Pool Controller Class

Updating the Application User Interface

Summary

Chapter 19 Accessing Amazon DynamoDB

Creating Amazon DynamoDB Tables

Populating the User Table with an AWS Lambda Function

Testing the AWS Lambda Function

The User Class

The Friend Class

The Chat Class

The ChatManager Class

The DynamoDBController Class

Linking the User Pool to the Identity Pool

The Updated Home Activity

The AddFriendActivity Class

Summary

Chapter 20 Adding AWSChat Support with Amazon DynamoDB and Amazon S3

Updating Project Settings

Updating the DynamoDBManager Class

Configuring Amazon S3

Creating the S3Controller Class

Updating the ChatManager Class

Updating the User Interface of the App

Summary

Chapter 21 Using AWS Lambda to Generate Thumbnails

Creating a Node.js Lambda Function Deployment Package

Creating an AWS Lambda Function Using the AWS Management Console

Testing the AWS Lambda Function

Updating the S3Controller Class

Updating the ChatManager Class

Updating the User Interface of the App

Summary

EULA

List of Tables

Chapter 2

TABLE 2.1

Chapter 4

TABLE 4.1

TABLE 4.2

TABLE 4.3

TABLE 4.4

Chapter 5

TABLE 5.1

Chapter 7

TABLE 7.1

TABLE 7.2

Chapter 15

TABLE 15.1

List of Illustrations

Chapter 1

FIGURE 1.1

Common cloud service models

FIGURE 1.2

Brief timeline of AWS services

FIGURE 1.3

Amazon Web Services home page

FIGURE 1.4

AWS sign-in screen

FIGURE 1.5

Creating login credentials

FIGURE 1.6

Contact Information screen

FIGURE 1.7

Payment Information screen

FIGURE 1.8

Identity Verification screen

FIGURE 1.9

Identity Verification PIN number

FIGURE 1.10

Completing the Identity Verification process

FIGURE 1.11

Support Plan selection

FIGURE 1.12

Completing the signup process

Chapter 2

FIGURE 2.1

Multiple Availability Zones in a single region

FIGURE 2.2

Geographically distant users accessing a video file from Tokyo

FIGURE 2.3

Edge locations can be used to cache frequently used content.

FIGURE 2.4

AWS home page

FIGURE 2.5

AWS Management Console home page

FIGURE 2.6

AWS Management Console menu bar

FIGURE 2.7

Services Menu

FIGURE 2.8

Resource Groups menu

FIGURE 2.9

Adding name tags to resources

FIGURE 2.10

Tagged resources are visible in the Resource Groups menu.

FIGURE 2.11

Resources in the Marketing Servers resource group

FIGURE 2.12

Account menu

FIGURE 2.13

AWS regions menu

Chapter 3

FIGURE 3.1

IAM users exist under the root AWS account.

FIGURE 3.2

Obtaining temporary credentials

FIGURE 3.3

IAM groups contain users and permissions.

FIGURE 3.4

Root account login screen

FIGURE 3.5

IAM user-specific login screen

FIGURE 3.6

AWS Management Console region selector

FIGURE 3.7

Accessing the IAM Management Console

FIGURE 3.8

User-specific IAM sign-in link

FIGURE 3.9

IAM resource dashboard

FIGURE 3.10

Location of the Add user button

FIGURE 3.11

User details screen

FIGURE 3.12

Configuring user permissions

FIGURE 3.13

Attaching the AdmnistratorAccess policy

FIGURE 3.14

Policy Details screen

FIGURE 3.15

Review user settings screen

FIGURE 3.16

Add user confirmation screen

FIGURE 3.17

IAM user list

FIGURE 3.18

IAM user permissions summary

FIGURE 3.19

Accessing the Create New Group button

FIGURE 3.20

Set Group Name screen

FIGURE 3.21

Attach Policy screen

FIGURE 3.22

Review group screen

FIGURE 3.23

Add Users to Group menu item

FIGURE 3.24

Selecting users to add to a group

FIGURE 3.25

Accessing the Create New Role button

FIGURE 3.26

Set Role Name screen

FIGURE 3.27

Select Role Type screen

FIGURE 3.28

Attaching a policy to a role

FIGURE 3.29

Review new role screen

FIGURE 3.30

Accessing MFA settings

FIGURE 3.31

Choosing the MFA device type

FIGURE 3.32

Manage MFA Device dialog box

FIGURE 3.33

Enter the authentication codes generated by the MFA device.

FIGURE 3.34

Second step of the login process for an account that has MFA enabled

FIGURE 3.35

IAM Password Policy settings

FIGURE 3.36

IAM dashboard after security settings have been configured

Chapter 4

FIGURE 4.1

Multiple EC2 instances from a single AMI

FIGURE 4.2

EC2 instance life cycle

FIGURE 4.3

Accessing the EC2 Management Console

FIGURE 4.4

AWS region selector drop-down and the Launch Instance button

FIGURE 4.5

List of Amazon machine images

FIGURE 4.6

AMI description

FIGURE 4.7

Select an EC2 instance type

FIGURE 4.8

EC2 instance configuration options

FIGURE 4.9

EC2 storage configuration options

FIGURE 4.10

The Delete on Termination option is available for EBS-backed instances.

FIGURE 4.11

Adding additional storage volumes to an EC2 instance

FIGURE 4.12

EC2 instance tags

FIGURE 4.13

EC2 instance security group configuration

FIGURE 4.14

Adding a custom traffic rule to a security group

FIGURE 4.15

EC2 instance settings review screen

FIGURE 4.16

EC2 instance public and private key configuration

FIGURE 4.17

Public and private key options

FIGURE 4.18

Creating a new key pair

FIGURE 4.19

Launch Status screen

FIGURE 4.20

Viewing a list of existing EC2 instances

FIGURE 4.21

Details of the selected EC2 instance

FIGURE 4.22

Changing EC2 instance state

FIGURE 4.23

Accessing EC2 instance tags

FIGURE 4.24

Updating EC2 instance tags

FIGURE 4.25

Determining the public IP of an EC2 instance

FIGURE 4.26

Determining the security group of an EC2 instance

FIGURE 4.27

Security group configuration

FIGURE 4.28

Changing the security group of an EC2 instance

FIGURE 4.29

Attaching multiple security groups to an EC2 instance

FIGURE 4.30

Accessing the Change Instance Type menu item

FIGURE 4.31

Modifying the instance type

FIGURE 4.32

AWS CLI commands

FIGURE 4.33

AWS CLI tool configuration

FIGURE 4.34

Creating an access key for an IAM user

FIGURE 4.35

AWS CLI tools installer

FIGURE 4.36

AWS CLI commands

FIGURE 4.37

AWS CLI tool configuration

FIGURE 4.38

Creating an access key for an IAM user

FIGURE 4.39

Downloading the PuTTY binaries

FIGURE 4.40

Loading a private key file

FIGURE 4.41

Exporting the private key in a different format

FIGURE 4.42

Creating a new PuTTY session

FIGURE 4.43

Specifying the location of the private key file in PuTTY

FIGURE 4.44

Creating a connection bookmark

FIGURE 4.45

Connecting to an EC2 instance using PuTTY

Chapter 5

FIGURE 5.1

Accessing the S3 Management Console

FIGURE 5.2

S3 Management Console welcome page

FIGURE 5.3

Specifying the bucket name and region

FIGURE 5.4

Configuring versioning, logging, and cost allocation tags

FIGURE 5.5

Configuring bucket permissions

FIGURE 5.6

S3 bucket summary

FIGURE 5.7

Properties, permissions, and management settings

FIGURE 5.8

Bucket contents screen

FIGURE 5.9

Selecting files in the file upload dialog box

FIGURE 5.10

Configuring file permissions

FIGURE 5.11

Configuring file storage class and encryption

FIGURE 5.12

File summary page

FIGURE 5.13

S3 bucket showing a file

FIGURE 5.14

Downloading a file from a bucket

FIGURE 5.15

Locating the file URL

FIGURE 5.16

Non-public buckets and files are not accessible using a URL

FIGURE 5.17

Accessing the Make public option

FIGURE 5.18

Making a file publicly accessible

FIGURE 5.19

Publicly accessible file in an S3 bucket

FIGURE 5.20

Storage class options

FIGURE 5.21

Delete object menu item

FIGURE 5.22

Enabling bucket versioning

FIGURE 5.23

Ensuring a document is publically accessible

FIGURE 5.24

Accessing document versions

FIGURE 5.25

Deleting a document version

FIGURE 5.26

Content selector switch

FIGURE 5.27

Restoring a deleted object

Chapter 6

FIGURE 6.1

Accessing the DynamoDB Management Console

FIGURE 6.2

DynamoDB splash screen

FIGURE 6.3

DynamoDB dashboard

FIGURE 6.4

Specifying a table name

FIGURE 6.5

Specifying a composite key for a table

FIGURE 6.6

Changing the provisioned IO capacity

FIGURE 6.7

DynamoDB table overview

FIGURE 6.8

Creating a new item in a table

FIGURE 6.9

Item attributes dialog showing default primary key attribute

FIGURE 6.10

Adding item attributes

FIGURE 6.11

Specifying multiple attributes

FIGURE 6.12

Viewing item attributes as JSON

FIGURE 6.13

DynamoDB table with one item

FIGURE 6.14

Each item in a DynamoDB table can have different attributes.

FIGURE 6.15

Creating an index

FIGURE 6.16

Index properties dialog

FIGURE 6.17

DynamoDB table index list

FIGURE 6.18

Manadatory fields for new items

FIGURE 6.19

Multiple items in a DynamoDB table

FIGURE 6.20

List of items returned as a result of a scan operation

FIGURE 6.21

Adding a filter expression to a scan

FIGURE 6.22

Indexes can be used while performing a scan.

FIGURE 6.23

Switching from scan mode to query mode

FIGURE 6.24

Querying a DynamoDB table based on the partition key

Chapter 7

FIGURE 7.1

Accessing the AWS Lambda management console

FIGURE 7.2

AWS Lambda splash screen

FIGURE 7.3

AWS Lambda dashboard

FIGURE 7.4

List of existing Lambda functions

FIGURE 7.5

List of function blueprints

FIGURE 7.6

Selecting the Node.js 4.3 Blank Function blueprint

FIGURE 7.7

The Blank Function blueprint does not have preconfigured triggers.

FIGURE 7.8

Lambda function name, description, and runtime environment

FIGURE 7.9

Editing node.js Lambda function code inline

FIGURE 7.10

Configuring an execution role for the Lambda function

FIGURE 7.11

Lambda function review screen

FIGURE 7.12

List of Lambda functions

FIGURE 7.13

Accessing the code and settings for an existing Lambda function

FIGURE 7.14

Configuring a test event

FIGURE 7.15

Lambda function execution results

FIGURE 7.16

Configuring a different test event

FIGURE 7.17

Accessing the Delete function menu item

FIGURE 7.18

Accessing the CloudWatch dashboard

FIGURE 7.19

List of CloudWatch log groups

FIGURE 7.20

Accessing the Delete log group menu item.

Chapter 8

FIGURE 8.1

Installing CocoaPods

FIGURE 8.2

Testing your CocoaPods installation

FIGURE 8.3

Xcode project options dialog

FIGURE 8.4

CocoaPods creates a workspace file in the original project folder.

FIGURE 8.5

Carthage web page

FIGURE 8.6

Carthage installer screen

FIGURE 8.7

Xcode project options dialog box

FIGURE 8.8

A Finder window showing the Carthage subfolder in the original project folder

FIGURE 8.9

Adding embedded binaries to the Xcode project

FIGURE 8.10

Adding a Run Script phase to the Xcode project

FIGURE 8.11

Final Run Script phase setup

FIGURE 8.12

Xcode project options dialog box

FIGURE 8.13

Adding embedded binaries to the Xcode project

FIGURE 8.14

Adding a Run Script phase to the Xcode project

FIGURE 8.15

Final Run Script Phase Setup

Chapter 9

FIGURE 9.1

Contents of the Main.storyboard file

FIGURE 9.2

Contents of the ChatJourney.storyboard file

FIGURE 9.3

Accessing the Amazon Cognito service home page

FIGURE 9.4

Amazon Cognito splash screen

FIGURE 9.5

Creating a new user pool

FIGURE 9.6

Specifying the name of the new user pool

FIGURE 9.7

User pool attributes

FIGURE 9.8

Setting up password security requirements for the Amazon Cognito user pool

FIGURE 9.9

Multi-factor authentication settings for the user pool

FIGURE 9.10

Customizing e-mail and SMS verification messages

FIGURE 9.11

Cost allocation tag setup screen

FIGURE 9.12

You can set up a user pool to remember devices.

FIGURE 9.13

Configuring applications that will have access to unauthenticated APIs

FIGURE 9.14

Create application screen

FIGURE 9.15

User pool review screen

FIGURE 9.16

Selecting the AWSChatUserPool to access its contents and settings

FIGURE 9.17

Click the Show Details button to reveal the App client id and the App client secret.

FIGURE 9.18

The App client id and the App client secret are needed to access unauthenticated user pool APIs.

FIGURE 9.19

Users need to provide the 6-digit confirmation code that was sent by e-mail.

FIGURE 9.20

List of users in the user pool

Chapter 10

FIGURE 10.1

Location of the Add a New App button in the Facebook developer portal

FIGURE 10.2

Create a new application identifier

FIGURE 10.3

Location of the Add Platform button

FIGURE 10.4

Select iOS from the list of available platforms

FIGURE 10.5

Location of the Xcode Bundle Identifier

FIGURE 10.6

iOS platform settings in the Facebook developer page

FIGURE 10.7

Location of the Facebook App ID

FIGURE 10.8

Facebook SDK for iOS download page

FIGURE 10.9

Placing the downloaded Facebook SDK files with the AWSChat project files in Finder

FIGURE 10.10

Xcode copy files dialog box

FIGURE 10.11

Adding the path to the Facebook SDK to the project Build Settings

FIGURE 10.12

Viewing the Info.plist file as source code

FIGURE 10.13

Xcode Project Navigator context menu

FIGURE 10.14

Xcode file template dialog box

FIGURE 10.15

Objective-C Bridging Header setup

FIGURE 10.16

Accessing the Amazon Cognito service home page

FIGURE 10.17

Amazon Cognito splash screen

FIGURE 10.18

Creating a new identity pool

FIGURE 10.19

Specifying the Facebook App ID in an identity pool

FIGURE 10.20

By default, Amazon Cognito creates new roles for authenticated and unauthenticated identities.

FIGURE 10.21

Setting up constraints for the new View object

FIGURE 10.22

Changing the custom class of the View object

FIGURE 10.23

List of available identity pools

FIGURE 10.24

Location of the Edit identity pool button

FIGURE 10.25

Location of the identity pool ID

FIGURE 10.26

The Facebook Login button is visible on the login screen of the app.

FIGURE 10.27

The Facebook SDK presents the user interface to allow users to provide their Facebook credentials.

FIGURE 10.28

Users are asked for permission to allow the AWSChat app access to elements of their public Facebook profile.

FIGURE 10.29

Successful Facebook sign-in

FIGURE 10.30

Identity browser

FIGURE 10.31

Amazon Cognito sync datasets under the Identity object

FIGURE 10.32

Contents of the facebookUserData dataset

Chapter 11

FIGURE 11.1

Google SDK download page

FIGURE 11.2

Xcode file import dialog box

FIGURE 11.3

Additional libraries to add to the project

FIGURE 11.4

Xcode build settings

FIGURE 11.5

Click the Get a Configuration File button.

FIGURE 11.6

Specifying the app name and bundle identifier

FIGURE 11.7

Expand the Google Sign-In option to reveal the Enable Google Sign-In button.

FIGURE 11.8

Google Sign-In has been enabled for your app.

FIGURE 11.9

Download GoogleService-Info.plist button.

FIGURE 11.10

Add the GoogleService-Info.plist file under the AWSChat folder group in Xcode.

FIGURE 11.11

Accessing the Amazon Cognito service home page

FIGURE 11.12

Amazon Cognito splash screen

FIGURE 11.13

List of identity pools

FIGURE 11.14

Editing the identity pool

FIGURE 11.15

Locating the Google Client ID field

FIGURE 11.16

Specifying the Google Client ID

FIGURE 11.17

Adding a new view to the login scene

FIGURE 11.18

Changing the custom class associated with the view

FIGURE 11.19

Expanding the URL Types section

FIGURE 11.20

Specifying a URL type

FIGURE 11.21

Application login screen with the Google Sign in button

FIGURE 11.22

The Google SDK presents the user interface to allow users to provide their Google credentials.

FIGURE 11.23

Google Sign-In result

FIGURE 11.24

List of Identity objects in the identity pool

FIGURE 11.25

Accessing the Amazon Cognito sync datasets under the Identity object

FIGURE 11.26

Contents of the googleUserData dataset

Chapter 12

FIGURE 12.1

Amazon DynamoDB table structure

FIGURE 12.2

Accessing the Amazon DynamoDB service home page

FIGURE 12.3

Amazon DynamoDB splash screen

FIGURE 12.4

Amazon DynamoDB dashboard

FIGURE 12.5

Creating the User table

FIGURE 12.6

Changing the provisioned IO capacity for the User table

FIGURE 12.7

Overview of the User table

FIGURE 12.8

Amazon DynamoDB dashboard showing all four tables

FIGURE 12.9

Click the role that you want to edit.

FIGURE 12.10

Location of the Create Role Policy button

FIGURE 12.11

Using the Policy Generator to Create Role Permissions

FIGURE 12.12

Click on the Add Statement button to add a permission to the role policy.

FIGURE 12.13

Four permissions have been added to the role policy.

FIGURE 12.14

Rename the policy before clicking the Apply Policy button.

FIGURE 12.15

A new policy has been added to the IAM role.

FIGURE 12.16

Creating an IAM role

FIGURE 12.17

Selecting the AWS Lambda Service Role

FIGURE 12.18

Select the AmazonDynamoDBFullAccess Policy.

FIGURE 12.19

Provide a name for the new role.

FIGURE 12.20

The new IAM role is listed along with other existing IAM roles.

FIGURE 12.21

Accessing the AWS Lambda service home page

FIGURE 12.22

AWS Lambda splash screen

FIGURE 12.23

AWS Lambda dashboard

FIGURE 12.24

Selecting the cognito-sync-trigger blueprint

FIGURE 12.25

Selecting the source for the Amazon Cognito sync trigger

FIGURE 12.26

Setting up the AWS Lambda function

FIGURE 12.27

Specifying the AWS Lambda function execution role

FIGURE 12.28

Specifying the execution timeout

FIGURE 12.29

AWS Lambda Function review screen

FIGURE 12.30

Setting up the AWS Lambda function

FIGURE 12.31

AWS Lambda Function dashboard

FIGURE 12.32

Configuring a test event

FIGURE 12.33

AWS Lambda Function test results

FIGURE 12.34

Amazon Cognito splash screen

FIGURE 12.35

List of Amazon Cognito identity pools

FIGURE 12.36

Amazon Cognito identity pool authentication providers

FIGURE 12.37

Xcode attributes inspector

FIGURE 12.38

Table view cell layout

FIGURE 12.39

Chat journey storyboard file

FIGURE 12.40

Contents of the User table

FIGURE 12.41

The Add friend view controller

FIGURE 12.42

Contents of the Friend table

FIGURE 12.43

Home view controller

Chapter 13

FIGURE 13.1

Accessing the Amazon S3 service home page

FIGURE 13.2

Amazon S3 landing page

FIGURE 13.3

List of existing Amazon S3 buckets in your AWS account

FIGURE 13.4

Specify a bucket name and region.

FIGURE 13.5

Configuring bucket properties

FIGURE 13.6

Configuring bucket permissions

FIGURE 13.7

Reviewing Amazon S3 bucket settings

FIGURE 13.8

The Amazon S3 Management Console after both buckets have been created

FIGURE 13.9

Click a role to edit the role.

FIGURE 13.10

Click the Create Role Policy button.

FIGURE 13.11

Use the Policy Generator to create a policy.

FIGURE 13.12

Permitting access to an Amazon S3 bucket

FIGURE 13.13

IAM policy generator with permissions that allow access to Amazon S3 buckets

FIGURE 13.14

Specifying a name for the new policy

FIGURE 13.15

IAM role with a list of attached policies

FIGURE 13.16

Updated chat journey storyboard

FIGURE 13.17

Chat view and upload image view

FIGURE 13.18

Uploaded images are visible in the Amazon S3 bucket.

FIGURE 13.19

Messages are visible in the Message table.

Chapter 14

FIGURE 14.1

Download the installer for the latest version of Node.JS on your computer.

FIGURE 14.2

Node.JS installer

FIGURE 14.3

Contents of the ThumbnailGenerator folder in Finder

FIGURE 14.4

List of IAM roles in your AWS account

FIGURE 14.5

Adding a policy to the IAM role

FIGURE 14.6

Select the AmazonS3FullAccess policy.

FIGURE 14.7

The AmazonS3FullAccess policy is present in the list of policies attached to the role.

FIGURE 14.8

Accessing the AWS Lambda Management Console

FIGURE 14.9

Creating an AWS Lambda function

FIGURE 14.10

Select the Blank Function blueprint.

FIGURE 14.11

Select S3 as the event source.

FIGURE 14.12

Configuring the Amazon S3 trigger

FIGURE 14.13

Provide a name and description for the AWS Lambda function.

FIGURE 14.14

Specifying the execution role

FIGURE 14.15

Change the AWS Lambda function timeout to 4 minutes.

FIGURE 14.16

Click on the Create Function button to finish creating the AWS Lambda function.

FIGURE 14.17

Contents of the image bucket

FIGURE 14.18

List of AWS Lambda functions in your AWS account

FIGURE 14.19

Testing an AWS Lambda function

FIGURE 14.20

Configuring a Test event

FIGURE 14.21

Results of testing the AWS Lambda function

FIGURE 14.22

A thumbnail has been generated by the AWS Lambda function.

Chapter 15

FIGURE 15.1

Selecting a view mode in the Android Studio project window

FIGURE 15.2

Accessing the app-level build.gradle file

Chapter 16

FIGURE 16.1

User interface of the Login and Signup activities

FIGURE 16.2

Accessing the Amazon Cognito service home page

FIGURE 16.3

Amazon Cognito splash screen

FIGURE 16.4

Creating a new user pool

FIGURE 16.5

Specifying the name of the new user pool

FIGURE 16.6

User pool attributes

FIGURE 16.7

Setting up password security requirements for the Amazon Cognito user pool

FIGURE 16.8

Multi-Factor Authentication settings for the user pool

FIGURE 16.9

Customizing e-mail and SMS verification messages

FIGURE 16.10

Cost allocation tag setup screen

FIGURE 16.11

You can set up a user pool to remember devices.

FIGURE 16.12

Configuring applications that will have access to unauthenticated APIs

FIGURE 16.13

Create application screen

FIGURE 16.14

User pool review screen

FIGURE 16.15

Selecting the AWSChatUserPool to access its contents and settings

FIGURE 16.16

Click the Show Details button to reveal the app client ID and the app client secret.

FIGURE 16.17

The app client ID and the app client secret are needed to access unauthenticated user pool APIs.

FIGURE 16.18

AndroidManifest.xml file

FIGURE 16.19

Android Studio project window

FIGURE 16.20

Custom dialog box presented to allow the user to enter a confirmation code

FIGURE 16.21

List of users in the user pool

Chapter 17

FIGURE 17.1

Location of the Add a New App button in the Facebook developer portal

FIGURE 17.2

Create a new application identifier.

FIGURE 17.3

Location of the Add Platform button

FIGURE 17.4

Select Android from the list of available platforms.

FIGURE 17.5

Configuring an Android application on the Facebook developer portal

FIGURE 17.6

Package name warning dialog box

FIGURE 17.7

Accessing the Facebook application identifier

FIGURE 17.8

Accessing the application build.gradle file

FIGURE 17.9

Accessing the Amazon Cognito service home page

FIGURE 17.10

Amazon Cognito splash screen

FIGURE 17.11

Creating a new identity pool

FIGURE 17.12

Specifying the Facebook app ID in an identity pool

FIGURE 17.13

Amazon Cognito by default, creates new roles for authenticated and unauthenticated Identities.

FIGURE 17.14

List of identity pools in your AWS account

FIGURE 17.15

Location of the Edit identity pool button

FIGURE 17.16

Accessing the identity pool ID

FIGURE 17.17

The Facebook login button widget in the activity layout file

FIGURE 17.18

Login activity with the Facebook login widget

FIGURE 17.19

The Facebook SDK provides the user interface to allow a user to provide their Facebook credentials.

FIGURE 17.20

List of federated identities in the identity pool

FIGURE 17.21

Accessing the facebookUserData data set

FIGURE 17.22

The Facebook-provided name and e-mail address is visible in the data set.

Chapter 18

FIGURE 18.1

Verify that the Google Repository entry is selected.

FIGURE 18.2

Location of the GET A CONFIGURATION FILE button

FIGURE 18.3

Creating an entry for the AWSChat app on the Google Developer console

FIGURE 18.4

Google Sign-In configuration

FIGURE 18.5

Click the ENABLE GOOGLE SIGN-IN button after providing the SHA-1 hash of your Android debug certificate.

FIGURE 18.6

Confirmation that Google Sign-In has been enabled for the app

FIGURE 18.7

Download the google-services.json file.

FIGURE 18.8

Adding the google-services.json file to the AWSChat Android Studio project

FIGURE 18.9

Accessing the Amazon Cognito service home page

FIGURE 18.10

Amazon Cognito splash screen

FIGURE 18.11

List of identity pools

FIGURE 18.12

Editing the identity pool

FIGURE 18.13

Locating the Google Client ID field

FIGURE 18.14

Specifying the Google Client ID

FIGURE 18.15

AWS Identity and Access Management dashboard

FIGURE 18.16

Creating a new identity provider

FIGURE 18.17

Configuring an identity provider

FIGURE 18.18

Amazon Cognito asks you to verify the thumbprint of the SSL certificate obtained from Google’s server.

FIGURE 18.19

The list of identity providers now contains an entry for accounts.google.com.

FIGURE 18.20

Adding the Google Client ID of the AWSChat app to the OpenID Connect provider

FIGURE 18.21

Enabling the accounts.google.com OpenID Connect provider

FIGURE 18.22

Login Activity layout with the Google Sign-In widget

FIGURE 18.23

Login Activity with the Google Sign-In button

FIGURE 18.24

Google SDK provides a secure form where users can provide their Google credentials.

FIGURE 18.25

List of identities in the identity pool

FIGURE 18.26

Google federated identities have a dataset called googleUserData.

FIGURE 18.27

Google-provided name and e-mail address of the user associated with the federated identity

Chapter 19

FIGURE 19.1

Amazon DynamoDB table structure

FIGURE 19.2

Accessing the Amazon DynamoDB service home page

FIGURE 19.3

Amazon DynamoDB splash screen

FIGURE 19.4

Amazon DynamoDB dashboard

FIGURE 19.5

Creating the User table

FIGURE 19.6

Changing the provisioned IO capacity for the User table

FIGURE 19.7

Overview of the User table

FIGURE 19.8

Amazon DynamoDB dashboard showing all four tables

FIGURE 19.9

Click the role that you want to edit.

FIGURE 19.10

Location of the Create Role Policy button

FIGURE 19.11

Using the Policy Generator to create role permissions

FIGURE 19.12

Click the Add Statement Button to Add a Permission to the Role Policy.

FIGURE 19.13

Four permissions have been added to the role policy.

FIGURE 19.14

Rename the policy before clicking the Apply Policy button.

FIGURE 19.15

A new policy has been added to the IAM role.

FIGURE 19.16

Creating an IAM role

FIGURE 19.17

Selecting the AWS Lambda service role

FIGURE 19.18

Select the AmazonDynamoDBFullAccess policy.

FIGURE 19.19

Provide a name for the new role.

FIGURE 19.20

Review IAM role screen

FIGURE 19.21

The new IAM role is listed along with other existing IAM roles.

FIGURE 19.22

Accessing the AWS Lambda service home page

FIGURE 19.23

AWS Lambda splash screen

FIGURE 19.24

AWS Lambda dashboard

FIGURE 19.25

Selecting the cognito-sync-trigger blueprint

FIGURE 19.26

Selecting the source for the Amazon Cognito sync trigger

FIGURE 19.27

Setting up the AWS Lambda function

FIGURE 19.28

Specifying the AWS Lambda function execution role

FIGURE 19.29

Specifying the execution timeout

FIGURE 19.30

AWS Lambda function review screen

FIGURE 19.31

List of AWS Lambda functions

FIGURE 19.32

AWS Lambda function dashboard

FIGURE 19.33

Configuring a test event

FIGURE 19.34

AWS Lambda function test results

FIGURE 19.35

Amazon Cognito splash screen

FIGURE 19.36

List of identity pools

FIGURE 19.37

The Authentication Providers section of the identity pool

FIGURE 19.38

Home Activity showing a list of friends

FIGURE 19.39

Contents of the User table

FIGURE 19.40

You can add other users to your friend list.

FIGURE 19.41

Contents of the Friend table

Chapter 20

FIGURE 20.1

Accessing the Amazon S3 service home page

FIGURE 20.2

Amazon S3 landing page

FIGURE 20.3

List of existing Amazon S3 buckets in your AWS account

FIGURE 20.4

Specify a bucket name and region.

FIGURE 20.5

Configuring bucket properties

FIGURE 20.6

Configuring bucket permissions

FIGURE 20.7

Reviewing Amazon S3 bucket settings

FIGURE 20.8

The Amazon S3 Management Console after both buckets have been created

FIGURE 20.9

Click a role to edit the role.

FIGURE 20.10

Click the Create Role Policy button.

FIGURE 20.11

Use the Policy Generator to create a policy.

FIGURE 20.12

Permitting access to an Amazon S3 bucket

FIGURE 20.13

IAM Policy Generator with permissions that allow access to Amazon S3 buckets

FIGURE 20.14

Specifying a name for the new policy

FIGURE 20.15

IAM role with a list of attached policies

FIGURE 20.16

Chat view and upload image view

FIGURE 20.17

Uploaded images are visible in the Amazon S3 bucket.

FIGURE 20.18

Messages are visible in the message table.

Chapter 21

FIGURE 21.1

Download the installer for version 7.9.0 of Node.js on your computer.

FIGURE 21.2

Node.js Installer

FIGURE 21.3

Contents of the ThumbnailGenerator folder in Finder

FIGURE 21.4

List of IAM roles in your AWS account

FIGURE 21.5

Adding a policy to the IAM role

FIGURE 21.6

Select the AmazonS3FullAccess policy.

FIGURE 21.7

The AmazonS3FullAccess policy is present in the list of policies attached to the role.

FIGURE 21.8

Accessing the AWS Lambda Management Console

FIGURE 21.9

Creating an AWS Lambda function

FIGURE 21.10

Select the Blank Function blueprint.

FIGURE 21.11

Select S3 as the event source.

FIGURE 21.12

Configuring the S3 trigger

FIGURE 21.13

Provide a name and description for the AWS Lambda function.

FIGURE 21.14

Specifying the execution role

FIGURE 21.15

Change the AWS Lambda function timeout to 4 minutes.

FIGURE 21.16

Click on the Create Function button to finish creating the AWS Lambda function.

FIGURE 21.17

Contents of the image bucket

FIGURE 21.18

The list of AWS Lambda functions in your AWS account

FIGURE 21.19

Testing an AWS Lambda function

FIGURE 21.20

Configuring a Test event

FIGURE 21.21

Results of testing the AWS Lambda function

FIGURE 21.22

A thumbnail has been generated by the AWS Lambda function.

FIGURE 21.23

Chat window showing thumbnails

Guide

Cover

Table of Contents

Introduction

Pages

xix

xx

xxi

xxii

xxiii

xxiv

1

3

4

5

6

7

8

9

10

11

13

15

17

18

19

20

21

22

23

25

26

28

29

30

31

33

34

35

36

37

38

39

40

41

43

44

45

47

48

49

50

51

52

53

55

56

57

58

61

62

63

66

67

68

69

71

72

73

75

76

78

79

81

82

84

85

86

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

111

113

115

117

118

119

120

121

123

124

125

126

127

128

129

130

131

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

152

153

154

155

157

158

159

160

161

162

163

164

165

166

167

169

170

171

172

173

174

175

176

177

178

179

180

181

183

184

185

187

188

189

190

191

193

194

195

196

197

198

199

201

202

203

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

225

226

227

228

229

230

231

232

233

234

235

237

238

240

241

242

243

244

245

246

247

248

249

250

251

252

253

254

255

256

257

258

259

260

261

262

263

264

266

267

269

270

271

272

273

274

275

276

278

280

281

282

283

284

285

286

287

288

289

290

291

292

292

363

364

365

366

367

368

369

370

371

373

375

376

378

379

380

382

383

384

385

386

387

388

389

390

391

392

393

394

395

396

397

398

399

400

401

402

403

405

406

407

408

409

410

411

412

413

414

415

416

418

419

421

422

423

424

426

427

428

429

430

431

432

433

434

435

437

438

439

441

443

445

446

447

448

449

450

452

453

454

455

456

457

458

459

460

461

462

463

464

465

466

467

468

469

469

470

472

473

474

475

476

477

478

479

480

481

482

483

484

485

486

487

487

488

490

491

492

493

494

495

496

497

498

499

500

501

502

503

504

505

506

507

508

509

510

511

512

513

515

516

517

518

519

520

521

522

523

524

525

526

527

528

529

530

531

532

534

535

536

537

538

539

540

541

542

543

544

545

546

547

548

549

550

551

552

553

555

556

557

558

559

560

561

562

563

564

565

566

567

568

569

570

571

572

573

574

575

577

578

579

580

581

582

583

585

586

587

588

589

590

592

593

595

597

599

600

601

602

603

604

605

606

607

608

609

610

611

612

612

613

615

616

617

618

619

620

621

622

623

624

625

626

627

628

629

630

631

632

633

634

635

636

637

638

639

640

641

642

643

644

645

646

647

648

649

650

651

652

653

654

655

656

657

658

659

660

661

662

663

664

665

666

667

668

669

670

671

672

674

675

677

678

679

680

681

682

683

684

685

686

687

688

689

690

691

692

693

694

695

696

697

698

699

700

701

702

703

704

705

706

707

708

709

710

711

712

713

714

715

716

717

718

719

720

721

722

723

725

727

728

729

730

731

733

734

736

737

738

739

740

741

742

743

744

745

746

Introduction

Amazon Web Services (AWS) is one of the leading cloud-computing platforms in the industry today. At the time this book was written, AWS offered 97 services, each of which resided in one of 18 different service categories. For someone who is new to cloud computing or to the AWS ecosystem, the sheer number of services on offer can be daunting. It can be difficult to know where to begin and what services to focus on.

Developers working in the mobile space are often ignorant of the power of the public cloud and AWS in particular. They end up spending months writing applications and server-side code for commonly used features such as user registration, user login, password recovery, server-side data storage—features that are already provided by AWS and can be integrated in a fraction of the time.

Architects who have primarily worked in on-premise (private cloud) environments often shy away from designing solutions that leverage public cloud capabilities.

This book is written to provide developers and architects working in the mobile space an introduction to some of the services offered by AWS along with step-by-step examples of how to leverage AWS cloud features to build an iOS- and Android-based chat application similar to WhatsApp.

This is one of the first few books that addresses both iOS and Android developers. AWS is vast and rapidly evolving, and I have had to make hard choices on what services to include and exclude in this book.

I have also made every attempt to keep the content up-to-date and relevant. Even though this makes the book susceptible to being outdated on a few rare instances, I am confident the content will remain useful and relevant through the next versions of the AWS services, Swift, Java, Xcode, and Android Studio.

The book at all times attempts to balance theory and practice, giving you enough visibility into the underlying concepts and providing you with the best practices and practical advice that you can apply at your workplace right away.

Who This Book Is For

This book is best suited for intermediate to advanced iOS and Android developers who want to learn to leverage aspects of the Amazon cloud from their apps. The book is also useful to system architects, application architects, and devops engineers who want to be introduced to some of the commonly used AWS services in the mobile space.

I advise that you read all chapters in Part I of the book from start to finish. If you are a developer, you may then want to proceed to Part II or III for step-by-step instructions on how to build a chat application using AWS cloud-based resources for iOS and Android.

What This Book Covers

This book covers aspects of Amazon IAM, Amazon Cognito, Amazon S3, Amazon DynamoDB, AWS Lambda, AWS Device Farm, Amazon SNS, and Amazon Mobile Analytics.

The iOS code in this book is written in Swift 3 and tested on Xcode 8.3.3. You may need to make minor modifications to the code if you are using a newer version of Xcode.

The Android code in this book is written in Java 6 and tested using Android Studio 2.3.1.

Services provided by Amazon, Apple, and Google are updated frequently. Therefore, sometimes you may encounter a newer version of a screen when you follow the instructions in a chapter.

How This Book Is Structured

This book consists of 29 chapters that are grouped into three sections. The first section, consisting of seven chapters, introduces the fundamentals of cloud computing and covers commonly used AWS products such as AWS IAM, Amazon Cognito, Amazon EC2, Amazon S3, Amazon DynamoDB, and AWS Lambda. The first section of the book also contains four additional bonus chapters that you can download from the book’s website.

Part II of the book is targeted at iOS developers and consists of seven chapters. Each chapter in this section progressively adds features to a chat application similar to WhatsApp. In addition to iOS code, several chapters in this section provide instructions to set up required resources in your AWS account to support the iOS code. You can download the source code that accompanies each chapter from this books’ web page on Sybex.com or using a GitHub link. You need to substitute AWS resources for things like Amazon S3 buckets, Amazon Cognito identity pools, and Amazon Cognito user pools. The text of each chapter in this part summarizes the AWS resources that you need to configure to follow along with the chapter. Part II of the book also contains two additional bonus chapters that you can download from the book’s website.

Part III of the book is targeted at Android developers and consists of seven chapters. Each chapter in this section progressively adds features to an Android version of a chat application similar to the one built in Part II. In addition to Android code, several chapters in this section provide instructions to set up required resources in your AWS account to support the Android code. If you have already followed the instructions in Part II of the book while developing the iOS version of the chat application, you can skip these instructions. Where applicable, chapters contain a note to indicate what sections can be skipped.

You can download the source code that accompanies each chapter from this book’s web page on Sybex.com or using a GitHub link. You need to substitute AWS resources for things like Amazon S3 buckets, Amazon Cognito identity pools, and Amazon Cognito user pools. The text of each chapter in this part provides a summary of the AWS resources that you need to configure to follow along with the chapter. Part III of the book also contains two additional bonus chapters that you can download from the book’s website.

If you are completely new to AWS, I recommend that you read every chapter in Part I sequentially and then proceed to either Part II or Part III depending on whether you are an iOS or an Android developer.

The chapters in Part I cover:

Introduction to Cloud Computing and Amazon Web Services (Chapter 1)

—A brief primer to cloud computing and Amazon Web Services. Covers commonly encountered service and deployment models.

Regions, Availability Zones, and Edge Locations (Chapter 2)

—This chapter introduces components of the AWS global infrastructure.

AWS Identity and Access Management (Chapter 3)

—This chapter introduces one of the key services provided by AWS to secure your resources in the Amazon cloud. It also provides instructions to sign up for an account under the AWS free tier.

Amazon EC2 (Chapter 4)

—This chapter introduces one of the core services provided by AWS: Amazon Elastic Compute Cloud (EC2).

Amazon S3 (Chapter 5)

—This chapter introduces one of the most commonly used storage services provided by AWS: Amazon Simple Storage Service (S3).

Amazon DynamoDB (Chapter 6)

—This chapter introduces Amazon’s managed NoSQL database service: DynamoDB.

AWS Lambda (Chapter 7)

—This chapter introduces AWS Lambda, a service designed to allow you to run code in the Amazon cloud without having to provision or manage an infrastructure.

Amazon Simple Notification Service (Bonus Chapter 1)

—This chapter introduces Amazon SNS, a service that allows you to send notifications through services such as APNS, GCM, SMS, and e-mail.

Amazon Mobile Analytics (Bonus Chapter 2)

—This chapter introduces Amazon Mobile Analytics, a service that allows you to capture application usage data and generate usage reports.

AWS Device Farm (Bonus Chapter 3)

—This chapter covers AWS Device Farm, a cloud-based app testing service.

Installing WordPress on Amazon EC2 (Bonus Chapter 4)

—This chapter provides step-by-step instructions to install WordPress onto an EC2 instance using the AWS CLI tools.

The chapters in Part II are for iOS developers and cover the following:

Integrating the AWS SDK for iOS (Chapter 8)

—This chapter contains instructions to integrate the AWS SDK for iOS in an Xcode project using CocoaPods, Carthage, and dynamic frameworks.

Implementing User Signup and Login Using Amazon Cognito User Pools (Chapter 9)

—This chapter contains instructions to create an Amazon Cognito user pool and use this user pool in a new Xcode project called AWSChat to allow new users to log in or sign up.

Implementing Login Using Facebook (Chapter 10)

—This chapter contains instructions to create an Amazon Cognito identity pool and use this identity pool in the iOS app along with the Facebook SDK to give users the option to log in to the AWSChat app using their Facebook credentials.

Implementing Login Using Google (Chapter 11)

—This chapter contains instructions to update the AWSChat app to allow users to log in using their Google credentials.

Accessing Amazon DynamoDB (Chapter 12)

—This chapter contains instructions to create a set of tables in Amazon DynamoDB and update the AWSChat app to allow users to add other users of the app as their friends.

Adding AWSChat Support Using Amazon DynamoDB and Amazon S3 (Chapter 13)

—This chapter contains instructions to create a set of Amazon S3 buckets and update the AWSChat app to allow users to send messages to their friends.

Using AWS Lambda to Generate Thumbnails (Chapter 14)

—This chapter contains instructions to create an AWS Lambda function to generate thumbnails out of images uploaded into an Amazon S3 bucket and to update the AWSChat app to allow users to send images to their friends.

Adding Support for Apple Push Notifications (Bonus Chapter 5)

—This chapter contains instructions to set up Amazon SNS resources and add support to the AWSChat app to receive push notifications.

Integrating Amazon Mobile Analytics with the iOS App (Bonus Chapter 6)

—This chapter contains instructions to set up Amazon Mobile Analytics resources and update the AWSChat app to send usage data to Mobile Analytics.

The chapters in Part III are for Android developers and cover the following:

Integrating the AWS SDK for Android with Android Studio (Chapter 15)

—This chapter contains instructions to integrate the AWS SDK for Android in an Android Studio project using Gradle and .jar files.

Implementing User Signup and Login Using Amazon Cognito User Pools (Chapter 16)

—This chapter contains instructions to create an Amazon Cognito user pool and use this user pool in a new Android Studio project called AWSChat to allow new users to log in or sign up.

Implementing Login Using Facebook (Chapter 17)

—This chapter contains instructions to create an Amazon Cognito identity pool and use this identity pool in the Android app along with the Facebook SDK to give users the option to log in to the AWSChat app using their Facebook credentials.

Implementing Login Using Google (Chapter 18)

—This chapter contains instructions to update the AWSChat app to allow users to log in using their Google credentials.

Accessing Amazon DynamoDB (Chapter 19)

—This chapter contains instructions to create a set of tables in Amazon DynamoDB and update the AWSChat app to allow users to add other users of the app as their friends.

Adding AWSChat Support Using Amazon DynamoDB and Amazon S3 (Chapter 20)

—This chapter contains instructions to create a set of Amazon S3 buckets and update the AWSChat app to allow users to send messages to their friends.

Using AWS Lambda to Generate Thumbnails (Chapter 21)

—This chapter contains instructions to create an AWS Lambda function to generate thumbnails out of images uploaded into an Amazon S3 bucket and update the AWSChat app to allow users to send images to their friends.

Adding Support for GCM Notifications (Bonus Chapter 7)

—This chapter contains instructions to set up Amazon SNS resources and add support to the AWSChat app to receive push notifications.

Integrating Amazon Mobile Analytics with the Android App (Bonus Chapter 8)

—This chapter contains instructions to set up Amazon Mobile Analytics resources and update the AWSChat app to send usage data to Mobile Analytics.

What You Need to Use This Book

If you are an iOS developer, you need the following:

Xcode 8.3.3 (for iOS Developers)

A suitable Mac for development

An iOS Developer Account

Reasonable proficiency in iOS development with Swift

Knowledge of how to register application identifiers, create provisioning profiles, and build development certificates on the iOS developer portal

If you are an Android developer, you need the following:

Android Studio 2.3.1

A suitable Mac or Windows computer

A Google developer account

Reasonable proficiency in Android development with Java

Both iOS and Android developers need the following:

An AWS account under which you can administer

Conventions

To help you get the most from the text and keep track of what’s happening, we’ve used a number of conventions throughout the book.

 Notes, tips, hints, tricks, and asides to the current discussion look like this.

As for styles in the text:

We

italicize

new terms and important words when we introduce them.

We use bold for text you must type exactly as shown.

We show keyboard strokes like this: Ctrl+A.

We show filenames, URLs, and code within the text like so:

persistence.properties

.

We present code in two different ways:

We use a monofont type with no highlighting for most code examples.

We use bold type to emphasize code that is of particular importance in the present context.

We also use bold font to indicate code you must enter as shown.

Source Code