Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Programming Amazon Web Services
SPECIAL OFFER: Upgrade this ebook with O’Reilly
A Note Regarding Supplemental Files
Preface
What’s in This Book?
Ruby and Interactive Examples
Conventions Used in This Book
Using Code Examples
Safari® Enabled
How to Contact Us
Acknowledgments
1. Infrastructure in the Cloud
Amazon Web Services for Infrastructure
Signing Up for Amazon Web Services
Thinking Like Amazon
Reality Check
Web Services Are Dependent on a Reliable Network
Amazon Does Not Offer Service Level Agreements for All Its Web Services
Data Security and Privacy
Specialized Infrastructure Requirements
Communication Channels for Fault Reporting and Resolution
Interfaces: REST and Query Versus SOAP
2. Interacting with Amazon Web Services
REST-Based APIs
HTTP Requests and Responses
REST and Query APIs
XML Documents
Interpreting XML documents with XPath
Hierarchical object structures
Building XML documents
HandlingService Errors
User Authentication
Request Descriptions
Signing Request Descriptions
Common Service Properties
Performing AWS Requests
REST API Implementation
Sending REST requests
Request authentication
Query API Implementation
Request parameters
Sending query requests
Request description
Utility Methods
Time adjustments
Base-64 encoding
Debug logging
3. S3: Simple Storage Service
S3 Overview
S3 Architecture
Pricing
Interacting with S3
REST API
S3 Implementation Stub
Constructing S3 URIs
Buckets
Bucket Locations
Bucket Names
Create a Bucket
Look Up a Bucket’s Location
List Your Buckets
Delete a Bucket
Objects
Object Keys and Hierarchical Naming
Object Metadata
Objects Are Immutable
Create or Replace an Object
Retrieving Objects
Retrieving Objects Conditionally
Listing Objects
Object details
Truncated listings
Searching
Listing parameters
Listing implementation
Demonstrating object searching
Deleting Objects
Create Objects from a Web Browser Using POST
HTML form for S3 POST
Policy Document for S3 POST
Generate a policy document
Generate a form
Alternative Hostnames
Access Control Lists
ACL Grantees
ACL Permissions
Retrieve a Resource’s ACL
Update a Resource’s ACL
Canned Access Policies
Update a Resource’s Canned ACL
Server Access Logging (Beta)
Configuring Server Access Logging
Logging Files
Retrieve Logging Settings
Modify Logging Settings
Access Permissions for Logging
Signed URIs
Distributing Objects with BitTorrent
4. S3 Applications
Share Large Files
Online Backup with AWS::S3
AWS::S3 Ruby Library
S3Backup Class
List Backed-Up Objects
Find Files to Back Up
Back Up Files
Delete Obsolete Objects
Putting It All Together
Content-Length Workaround
S3 Filesystem with ElasticDrive
Challenges
ElasticDrive: S3 As a Virtual Block Device
Setup and configuration
Mediated Access to S3 with JetS3t
JetS3t Gatekeeper
Deploy the Gatekeeper servlet
Configure and test Cockpit Lite
Authorization with HTTP Basic
Customizable authorization modules
Implement a custom authorization module
Next steps
5. EC2: Elastic Compute Cloud (Beta)
EC2 Overview
EC2 Instances
AMIs
The EC2 Environment
Pricing
Interacting with EC2
Query API
EC2 Implementation Stub
Keypairs
List Keypairs
Create a Keypair
Delete a Keypair
Network Security by IP
Allow IP Traffic
Finding Amazon Machine Images
List Available AMIs
Controlling Instances
Stop Running Instances
Starting Instances
List Running Instances
Log In to an Instance
Security Groups
List Security Groups
Creating Security Groups
Deleting Security Groups
Allow Traffic from EC2 Groups
Allow group traffic
Disallow Traffic by IP or Group
Managing and Sharing AMIs
Register an AMI
Deregistering an AMI
Modify Image Attributes
Describe Image Attributes
Reset AMI Attributes
Confirm an Instance’s Product Code
Console Output and Instance Reboot
Console Output Snapshot
Reboot Running Instances
6. Using EC2 Instances and Images
EC2 Instances in Detail
Linux Kernel
Network Addressing
Dynamic addressing issues
Instance Data
Instance data versioning
Instance Metadata
Instance user data
Performance
Data Management in EC2
Storage Locations
Ephemeral Storage
Modifying an AMI
AMI Security Auditing
Install Amazon’s Bundling Tools
Configure System Services
Bundling an Instance into an AMI
Uploading AMI Files to S3
Registering an AMI
Create an AMI from Scratch
Prepare the AMI Filesystem
Install Fedora 7 Base
Configure Networking
Startup Scripts
Install Additional Software
Cleanup
Bundle and Register Your AMI
7. EC2 Applications
Dynamic DNS
DynDNS: Free Dynamic DNS Service
EveryDNS.net
On-Demand VPN Server with OpenVPN
OpenVPN Security Group
Start an AMI
Install and Configure OpenVPN on an EC2 Instance
Install and Configure OpenVPN on a Client Computer
NAT Routing
Run OpenVPN as a Service
Web Photo Album with Gallery 2
Launch an EC2 Instance
Install an Apache Web Application Stack
Install the Gallery 2 Application
Data Backup to S3
Restoring Data from S3
Next Steps
8. SQS: Simple Queue Service
SQS Overview
SQS Architecture
Guidelines for SQS Applications
The Message Life Cycle
SQS Client Roles
Pricing
API Version 2008-01-01
Pricing for API version 2008-01-01
Changes in API version 2008-01-01
Interacting with SQS
Query API
SQS Implementation Stub
Queues
Create a Queue
List Queues
Deleting Queues
Messages
Sending Messages
Receiving Messages
Deleting Messages
Peeking at a Message
Controlling the Visibility of Messages
Queue Attributes
Retrieve Queue Attributes
Modify Queue Attributes
Queue Access Control
Grantees
Permissions
Listing a Queue’s Access Control Settings
Add an Access Control Rule
Revoke an Access Control Rule
9. SQS Applications
Messaging Simulator
Code Stub
Simulator Receiver
Test the receiver
Running Simulations
Simulation Scenarios
Getting started
Simple simulation
Checking efficiency
Multiple batches
Distributed Application Services with BOTO
The Boto Services Framework
Architecture
Services
Message queues
Message format
Start service script
Toward a Generic Service
Message format
MultiCommandService
VisibilityThread
Bootstrap Service Startup
Building a Distributed Application
Create a custom service instance
Bundle the service instance to an AMI
Testing the MultiCommandService
ImageMagick examples
FFmpeg example
Automated Management of EC2 Instance Pools with Lifeguard
Estimating Load
Managing the Pool
Installation and Testing
Managing a Pool of MultiCommandService Instances
Status notifications from MultiCommandService
A pool manager compatible with MultiCommandService AMIs
Configuring Lifeguard
Automation achieved
10. FPS: Flexible Payments Service (Beta)
FPS Overview
Transaction Participants
Transaction Walk-Through
Amazon Payments Accounts
Payment Instructions and Tokens
The Co-branded UI (CBUI) Pipeline
Branding
Handling responses
Payment Methods
Pricing
Interacting with FPS
Production and Sandbox Environments
Query API
FPS Implementation Stub
Service Response Messages
Common fields
Service errors
Idempotent Transactions
Managing Your Tokens
Gatekeeper Language Basics
Install Payment Instructions (Create a Token)
View Installed Payment Instructions
Retrieve a Token
List the Tokens in Your Account
Cancel a Token
View a Token’s Usage Limits
Acquiring Third-Party Tokens
Generating CBUI Request URIs
Interpreting CBUI Result URIs
Verifying a CBUI result URI
Using a web browser to obtain CBUI results
Using a simple web server to interpret CBUI results
Acquire a SingleUse Sender Token
Acquire a Multiuse Sender Token
Acquire a Recurring Sender Token
Allow a Third Party to Modify a Token
Pay Now Widgets
The Anatomy of a Pay Now Widget
Generate a Pay Now HTML Form
Interpreting Pay Now Widget Result URIs
11. FPS Transactions and Accounts
Performing FPS Transactions
Transaction Fees
Transaction References
Perform a Payment
Retrieve Transaction Details
Handling Transaction Results
Retry a Declined Transaction
Get Results
Discard Results
Perform a Refund
Reserve Credit Card Funds
Settle a Reserved Transaction
Account Management and Information
Retrieve Your Account Balance
Account Activity
12. FPS Advanced Topics
Gatekeeper Language Guide
How FPS Evaluates Gatekeeper Rules
Sample Gatekeeper Documents
Caller instructions
Recipient instructions
Refund sender instructions
Sender instructions
Sender statements for MultiUse or Recurring tokens
Gatekeeper Language Syntax
Assertions
Assignments
Value expressions
Gatekeeper Variables
Private variables
Global variables
Micropayments with FPS
Drawbacks of Micropayment Instruments
The Prepaid Payment Instrument
Acquire a Prepaid Token
Fund a prepaid instrument
Retrieve balance
Retrieve liability
List your prepaid instruments
Postpaid Payment Instrument
Acquire a postpaid token
Retrieve debt balance
Retrieve outstanding debt balance
Settle debt
WriteOffDebt
List your postpaid instruments
Building a Marketplace Application
Charging Fees for Access to Your Marketplace
Acquire a Recipient Token
Subscribing to FPS Event Notifications
Subscribe to Notifications
Unsubscribe from Notifications
13. SimpleDB (Beta)
SimpleDB Overview
A Simple Database, Not an RDBMS
Pricing
Interacting with SimpleDB
Query API
SimpleDB Implementation Stub
Service Response Messages
Domains
Create a Domain
List Your Domains
Delete a Domain
Items and Attributes
Attribute Parameters
Retrieve an Item’s Attributes
Create or Update an Item
Delete an Item’s Attributes
Representing Data in SimpleDB
Boolean Encoding
Date Encoding
Integer Encoding
Float Encoding
Automated Encoding and Decoding of Values
Performing Queries
Perform a SimpleDB Query
SimpleDB Query Expression Syntax
Predicates
Predicate operators
Set operations
Stock Price Database: A Mini SimpleDB Application
Obtain Historic Stock Price Data
Load Stocks Data into SimpleDB
Query and Retrieve Stock Data
Caching SimpleDB with Memcached
A. AWS Resources
AWS Online Resources
Amazon DevPay (Limited Beta)
Client Tools
Multiple Services
S3
EC2
API Libraries
Multiple Services
S3
EC2
SQS
Third-Party AWS Solutions
Multiple Services
S3
EC2
FPS
B. AWS API Error Codes
S3: Simple Storage Service
EC2: Elastic Compute Cloud
SQS: Simple Queue Service
FPS: Flexible Payments Service
SimpleDB
Index
About the Author
Colophon
SPECIAL OFFER: Upgrade this ebook with O’Reilly
← Prev
Back
Next →
← Prev
Back
Next →