Certified Developer Slides 1462373421
Certified Developer Slides 1462373421
Certified Solutions
Architect (CSA)
Certified DevOps Engineer Professional Level
http://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html
Amazon Web Services
Certified Developer Associate Level
Static Website Hosting
Amazon S3 Static Website Hosting
S3 allows you to host static HTML files
Can specify index file
Can specify custom error file
Supports custom domains and redirects
Amazon S3 gives a default URL
Redirect from www.linuxacademy.com to linuxacademy.com
Route 53 integration for custom domains
Bucket name must match domain name
Amazon S3 - URL
Every hosted bucket receives its own URL
Think in terms of namespaces
<bucket-name>.s3-website-<AWS-region>.amazonaws.com
Amazon S3 - Files
Index document
Error document
Supports custom error documents for 4XX clss errors
Custom redirect rules
Supports various types of simple and advances
redirects
Amazon Web Services
Certified Developer Associate Level
IAM and Bucket Policies
Amazon S3 Bucket Permissions
Can use bucket and/or user policies
Resource-based policies
User policies
Bucket permissions specify:
Who is allowed to access resources
What that user can do with those resources
AWS gives full permissions to the owner of a resource (bucket, object)
Resource owners can grant access to others, even cross-account
The bucket owner paying bills can deny access or modify objects
regardless of who owns them
Amazon S3 Bucket Policies
Resource-based policy
Uses a JSON file attached to the resource
Can grant other AWS accounts or IAM users permission for the bucket and objects
inside
Should be used to manage cross-account permissions for all Amazon S3
permissions
Limited to 20 KB in size
Amazon S3 Bucket Policy Example
Amazon S3 Bucket Policy Example
Amazon S3 ACLs
Used for both buckets and objects
Grant read/write permissions to other AWS accounts
You cannot grant conditional permissions
You cannot explicitly deny permissions
An object ACL is the only way to manage access to objects not owned by the
bucket owner
Amazon S3 IAM policies
Existing objects are unchanged
Added objects are given unique version IDs
Automatically generated by S3
Amazon Web Services
Certified Developer Associate Level
Object Versioning
Amazon S3 Versioning
Allows for multiple versions of an object
Protects against unintended overwrites and deletions
Automatically archives objects
Versioning is at the bucket level
Configured via the Console or SDKs
Enabling Versioning
Existing objects are unchanged
Added objects are given unique version IDs
Automatically generated by S3
Deleting versioned objects
All versions remain in the bucket but S3 inserts a delete marker
The delete marker becomes the current version
By default, GET requests retrieve the latest version
If the current version has a delete marker, it returns a 404 Not Found error
You can get previous versions, however, by specifying an ID
Permanently Deleting
To permanently delete a version, specify an ID
Restoring versioned objects
Any earlier version can be restored:
Copying a previous version into the same bucket will restore it as the current
version
Permanently delete the current version (by specifying its ID)
Copying an earlier version GETs the version and PUTs it in the bucket, giving it a
new ID
That new ID is the used as the current version
Using Lifecycle Management with Versioning
Lifecycle Management can dictate what happens to versions after a certain
amount of time
Example: Send noncurrent versions to Amazon Glacier after 30 days
Example: Permanently delete objects 180 days after they become
noncurrent
Can have separate policies for current and noncurrent versions
Disabling Versioning
Once version-enabled, a bucket cannot go back to being in an unversioned state
You can suspend versioning
Future objects are given a version ID of null
Already versioned objects do not change
To permanently delete a version, specify an ID
Amazon Web Services
Certified Developer Associate Level
S3 Encryption
Amazon S3 Protecting data using encryption
Protecting data in-transit
Using SSL or client-side encryption
On upload:
Client first sends a request to AWS KMS for a key
AWS KMS returns an encryption key (plain text used to encrypt object data,
and a cipher blob to upload to S3 as object metadata)
On download:
Client downloads the encrypted object form S3 with the cipher blob stored
in metadata
The client then sends that cipher blob to AWS KMS to get the plain text
Plain text is used to decrypt the object
Protecting data in-transit
Using a client-side master key
Master keys and unencrypted data are never sent to AWS
On upload:
Client provides a master key to the Amazon S3 encryption client
The S3 client generates a random data key and encrypts it with your master
key
The S3 client encrypts your data using the data key, and uploads a material
description as part of the object metadata (x-amz-meta-x-amz-key)
On download:
Client downloads encrypted object along with its metadata
That metadata tells the client which master key to use to decrypt
Using that master key, the client decrypts the data key
The data key is used to decrypt the object
Protecting data at rest Amazon S3-Managed Encryption
Amazon S3 provides server side encryption before saving data to disk
Add the x-amz-server-side-encryption request header to your upload
request
Uses AES-256 (Advanced Encryption Standard)
Bucket policies can require all objects to use server-side encryption
Protecting data at rest - Alternatives
KMS-Managed Encryption Keys
Uses customer master keys (CMKs)
Gives you more flexibility in controlling keys
Useful when connecting from outside of AWS (like your computer or application)
Amazon Web Services
Certified Developer Associate Level
DynamoDB Overview and Limits
DynamoDB Essentials
Fully managed NoSQL database
Can scale up and down depending on demand without downtime or
performance degradation
Manage data, not hardware or software
Built-in monitoring
Integrates monitoring
Integrates with AWS big data services such as Elastic MapReduce and Redshift
ProjectionType
KEYS_ONLY - Only the index and primary keys are projected (smallest index - more
performant)
INCLUDE - Only specified attributes are projected
ALL - All attributes are projected (biggest index - least performant)
DynamoDB: Important Limits
256 tables per region (can be increased on request)
Partition key length: 2048 bytes maximum, 1 byte minimum
Sort key length: 1024 bytes maximum, 1 byte minimum
Item size: 400KB including attribute name and value
API-specific limits
Example: Your items are 3KB in size and you want to read 80 (strongly consistent
read) items from a table per second
Item size 3KB
Want to read 80 items per second from the table
Formula: (ITEM SIZE (rounded up to the next 4KB multiplier) / 4KB) * # of items
80 * (3KB (round up to 4) / 4KB)
80 * 1 = 80 required provisioned read throughput
Example: Your items are 10KB in size and you want to read 80 (strongly consistent
read) items from a table per second
Item size 10KB
Want to read 80 items per second from the table
Formula: (ITEM SIZE (rounded up to the next 4KB multiplier) / 4KB) * # of items
80 * (10KB (round up to 12) / 4KB)
80 * 3 = 240 required provisioned read throughput
Example: Your items are 1.5KB in size and you want to write 10 items per second
Formula: (ITEM SIZE (rounded up to the next 1KB multiplier) / 1KB) * # of items
10 * (1.5KB (round up to 2) / 1KB)
10 * 2 = 20 required provisioned write throughput
Read Throughput with Local Secondary Indexes
Adding, updating, or deleting an item in a table also costs write capacity units to
perform the action on the local index
The cost of writing an item to a local secondary index depends on a few things:
If you write a new item to the table and that item defines an indexed attribute, or
if you update an existing item and write an indexed attribute that was previously
undefined, that will cost you one write operation to put the item in the index.
If you change the value of an indexed key attribute, two writes are required. One
to delete the previous item from the index, and another to put the new item into
the index.
If an update deletes an item that was in the index, one write is required to delete
the item from the index.
Read Throughput with Global Secondary Indexes
Global indexes have their own throughput capacity, completely separate from that of
the table's capacity.
Global indexes support eventually consistent reads, which means that a single global
secondary index query can get up to 8 KB per read capacity unit (because we take 4KB
and multiply it by 2)
Reads in global indexes are calculated the same as in tables, except that the size of the
index entries is used instead of the size of the entire item.
Write Throughput with Global Secondary Indexes
Putting, Updating, or Deleting items in a table consumes the index write capacity units
The cost of writing an item to a global index depends on a few things, and those are
identical to the local secondary index rules
Exceeding Throughput
Benefits:
Returns the items matching the primary key search
Much more efficient because it searches indexes only
Returns all attributes of an item, or only the ones you want
Is eventually consistent by default but can request a consistent read
Can use conditional operators and filters to return precise results
DynamoDB Scans
Reads every item in the table and is operationally inefficient
Looks for all items and attributes in a table by default
Benefits:
Scans can apply filters to the results to refine values
Can return only specific attributes with the ProjectionExpression parameter
Negatives:
The larger the data set in the table the slower performance of a scan
The more filters on the scan the slower the performance
Returns only filtered results
Only eventually consistent reads are available
DynamoDB Scans - If you must use them
item price
= $10
item price
= $10 item price item price
= $8 = $9
Can automatically
be blocked
Update price
item price
= $10
Amazon Web Services
Certified Developer Associate Level
Temporary Credentials
DynamoDB - Granting temporary access
You can use temporary security credentials to make calls to AWS services
Example: Users on your mobile application need the ability to communicate with
DynamoDB. How can you create permissions for each user to access DynamoDB
resources needed for your mobile application to work?
Options:
IAM roles
Web Identity Federation
Amazon Cognito
Identity Federation
You can grant users access when they sign in to external systems
outside of AWS
IAM supports two types of identity federation:
Enterprise identity federation - authenticate users in your
organizations network
Web identity federation - users can sign in with Amazon,
Facebook, Google, or any OpenID Connect (OIDC) 2.0
compatible provider
SDKs
Android
iOS
JavaScript
etc
AWS Mobile Hub
Lambda
Publisher Subscriber(s)
Amazon
SNS
HTTP/S
Example: A user completes the last puzzle of your mobile game. As a reward, you
want to send that user a special offer. You also want to send the users records to
another service for data analysis. This data analysis is used to figure out how the
user solved this very complicated puzzle.
(Endpoints)
SMS message
CloudWatch alarm
Or email
SNS topic
Amazon SNS - Publishers
The owner creates a topic and controls access to it
Policies determine which topic(s) publishers can write to
Notifications sent to a mobile end point have the ability to appear in the app
as:
Message alerts
Badge updates
Sound alerts
Amazon SNS Push Notification Services
Mobile push notification services:
Amazon Device Messaging (ADM)
Apple Push Notification Service (APNS)
Baidu Cloud Push
Google Cloud Messaging for Android
Microsoft Push Notification Service for Windows Phone
Windows Push Notification Services
(Push Notification Services)
ADM
APNS
Baidu Subscriber
Publisher endpoint
(mobile)
GCM
Amazon
SNS
MPNS
WNS& SMS
SNS Push Notifications Setup Process
Tight Coupling
Component
Loose Coupling
SQS Queue
Component
Amazon SQS Core Features
Redundant Infrastructure Guarantees delivery of your messages at least once
Queues can be configured You can have different settings for queues
depending on your needs
Delay Queues Control how much time goes by before a message is available
PCI Compliant Compliant with Payment Card Industry (PCI) Data Security
Standard (DSS), which means we can support the processing, storage, and
transmission of credit card data by a merchant or service provider
Amazon SQS Message Lifecycle
1. Component 1 sends Message A to a queue, and then the message is
redundantly distributed across SQS servers
3. Component 2 deletes the message from the queue during that visibility
timeout, or else it will get processed again.
Amazon SQS Visibility Timeout
Messages arent deleted by SQS once they are received and processed, instead
they must be deleted by the component
You can choose what the timeout is, and you can extend it for individual messages
if necessary
Short polling returns a result immediately, even if the queue is empty. It also only
checks a subset of servers, which could cause false empty responses.
Long polling doesnt return a response until there is a message in the queue. It also
checks every server to avoid false empty responses.
Long polling should be used when possible, because it can reduce costs and false
empty responses.
Amazon SQS Terms and limitations
Receive Message Wait Time If set to a value greater than 0, long polling is
enabled. This is the maximum amount of time that a long polling call will wait for a
message to become available before returning empty.
Dead letter queues Queues that other queues can send messages to, when
those messages could not be successfully processed. You can then analyze those
messages.
Amazon SQS Terms and limitations
Delay Queues
Min: 0 seconds
Max: 15 minutes
Visibility Timeout
Min: 0 seconds
Max: 12 hours
Description
This section follow the template version section
Descriptions help clearly differentiate between templates
Template Metadata
Metadata
JSON objects that provide details about the template
Template Parameters
Parameters
Values you can pass in right before template creation
Allows you to customize templates
Can have default values as well as allowed values
Template Mappings
Mappings
Lets you map keys to values
For example: You can make different values for different regions
Template Conditions
Conditions
Conditions can check values before deciding what to do
Allows you to create different resources in the same template
depending on the condition evaluation
Example: can create different environments for development and
production
Template Resources
Resources
This is where you create different resources, like S3, EC2 instances,
etc
The only required section
Template Outputs
Outputs
Can output values that youd like to see from the console or from API
calls
Example: can return the bucket name that you just created in S3
Intrinsic Functions
Used to pass in values that are not available until run time
Fn::GetAtt example
"Resources" : { "S3Bucket" : { } },
"Outputs" : {
"WebsiteURL" : {
"Value" : { "Fn::GetAtt" : [ "S3Bucket", "WebsiteURL" ] },
"Description" : "URL for website hosted on S3
}
}
Intrinsic Functions
Fn::FindInMap Returns the value of a key from a specified mapping
"Mappings" : {
"RegionMap" : {
"us-east-1" : { "32" : "ami-6411e20d", "64" : "ami-7a11e213" },
"us-west-1" : { "32" : "ami-c9c7978c", "64" : "ami-cfc7978a" },
"eu-west-1" : { "32" : "ami-37c2f643", "64" : "ami-31c2f645" }
}
},
"Resources" : {
"myEC2Instance" : {
"Type" : "AWS::EC2::Instance",
"Properties" : {
"ImageId" : { "Fn::FindInMap" : [ "RegionMap", { "Ref" : "AWS::Region" }, "32"]},
"InstanceType" : "m1.small
}
}
}
Other Intrinsic Functions
Fn::Join Concatenates elements, separated by a specified delimiter
Features:
Distributed
Can scale up or down depending on the task
Works with on-premises applications or applications on the cloud
A workflow can consist of human events
Workflows can last up to 1 year
Guarantees order of execution
Amazon Simple Workflow Service: Domains
workflow
Activity workers poll SWF for new tasks that they need to perform
After receiving the task, the activity worker will process the task however it is
Activity Task
A task assigned to a worker
Example: Encoding videos or checking inventory
Decision Task
Tells the decider that the state of the workflow execution has changed
Allows the decider to determine what the next activity is
Decision tasks happen whenever the state of the workflow changes (task
completed)
Amazon Web Services
Certified Developer Associate Level
SWF Examples
Amazon Simple Workflow Service
Examples:
Transcoding Videos
E-Commerce processing
NASA
https://aws.amazon.com/swf/testimonials/swfnasa/
Amazon Simple Workflow Service: E-Commerce example
Customer Order
Verify Order Charge Credit Card Ship Order Record Completion End
(Start)
Examples:
Transcoding Videos
E-Commerce processing
NASA
https://aws.amazon.com/swf/testimonials/swfnasa/
Amazon Simple Workflow Service: SQS vs. SWF
A VPC resembles:
Private data centers
Private corporate networks
Private Network
Private and public subnets
Scalable infrastructure
Ability to extend corporate/home network to the cloud as if it were part of
your network
Amazon VPC: Benefits of a VPC
Scenarios:
Peering two VPCs Company runs multiple AWS accounts and you need to
link all the resources as if they were all under one private network
Peering TO a VPC Multiple VPCs connect to a central VPC but cannot
communicate with each other, only the central VPC (file sharing, customer
access, Active Directory)
VPC Scenarios
Internet
route table
gateway Public
Internet
route table
client
VPN VPN
connection connection
route table
Public
Internet
route table
client
VPN VPN
connection connection
Virtual Private
Gateway
route table
Public
Internet
route table
client
VPN VPN
connection connection
Subnet Subnet
10.0.1.0/24 10.0.2.0/24
router
Credentials are associated with an IAM access control policy that limits what
the user can do
Access Key
Consists of an access key ID and a secret key
Session Token
Used to validate our users temporary security credentials
Identity broker
The broker is in charge of mapping the user to the right set of
credentials
Identity Store
An identity store is something like Facebook, Google, Amazon, or
Active Directory
Identities
A user or identity within an identity store
Temporary Credentials with Amazon EC2
Sign requests with your temporary security credentials that you get from
AWS STS
Use the access key ID and secret access key, and add your session token to
the API request
Add the session token to an HTTP header
OR add it to a query string parameter named X-AMZ-Security-Token
Example Scenario
A corporate web application is deployed within an Amazon VPC, and is
connected to the corporate data center via IPSec VPN. The application must
authenticate against the on-premises LDAP server. Once authenticated, logged-
in users can only access an S3 keyspace specific to the user.
Solution:
Develop an identity broker to authenticate against LDAP
Identity broker calls the STS API to receive temporary credentials
Application can then access the temporary AWS permissions
Amazon Web Services
Certified Developer Associate Level
Taking the Exam
Taking the Exam
https://www.webassessor.com/wa.do?page=publicHome
Congratulations!