AWS Developer Associate - by Thomas Haslett Flashcards
S3 Encryption: Protecting Data In-Transit (KMS)
1) Using an AWS-KMS managed customer (master) key
- Client gets a unique key for each object
2) On Upload:
- Send request to AWS KMS for key
- AWS KMS returns an encryption key
3) On Download:
- Client downloads encrypted object with their cipher blob stored in metadata -> blob to KMS -> get plain text key -> decrypt object
DynamoDB: Scans
1) Reads every item in a table and is operationally inefficient
2) Looks for all items and attributes in a table by defualt
SNS: Subscribers
1) Subscribe to a topic to receive published messages
2) Subscribers are end-points and include:
- Mobile apps
- Web servers
- Email addresses
- Amazon SQS queue
- AWS Lambda
Cloud Formation: Intrinsic Functions
1) Used to pass in values that are NOT available until runtime.
Example: “GetAtt”
SWF: Domains
1) A domain is used to help determine scope of work flows
2) Multiple workflows can live in a domain
3) Workflows cannot interact with workflows in OTHER domains
DynamoDB: Atomic Counters
1) Allows you to increment or decrement the value of an attribute without interfering with other write request
2) Request are applied in the order that they were received
3) Updates are NOT Idempotent: It will update the value each time it is called
SNS: Push Notification Setup Process
1) Needs a device token
2) There are Device Tokens and Registration IDs, depending on the mobile platform.
3) Request credentials from the mobile platform
4) Request Token from the mobile platform
5) Create a platform application object
6) Create a platform endpoint object
7) Publish a messages to the mobile endpoint
Cloud Formation
1) Allows you to create and provision resources in a reusable template fashion
2) Turns your resources into Stacks
3) Allows you to “source control” your infrastructure
4) Templates are in JSON format
S3 Performance: Sequence Pattern Issue
ISSUE: Using sequential object names cause writes to the same partition (overload I/O). KEY NAME is used to decide which partition they key is stored in
SOLUTION: Introduce randomness by using Hex Hash Prefix:
- use a has (like MD5) of a character sequence
- Pick a specific number of characters from that hash to use as the prefix OR reserve ID string
Cloud Formation: Resources
1) This is where you create different resources like S3, EC2, etc.
2) This section is REQUIRED
DynamoDB: Local Secondary Indexes
1) Partition key must be the same, but the sort key is different
2) “Local” because every partition is scoped to a table partition with the same partition key
3) uses the tables provisioned throughput
S3 Encryption: Protecting Data At-Rest (S3-managed)
1) AWS provides server-side encryption before saving data to disk
2) Add the “x-amz-server-side-encryption” request leader to your upload request
3) Uses AES-256
4) Bucket policies can require all objects use server-side encryption
5) Alternatives:
- KMS managed keys
- Customer provided keys
Deleting Versioned Objects
1) All versions remain in the bucket, but S3 inserts a “delete” marker
2) The “delete” marker becomes the current version
3) GET request retrieve the latest version
4) If current version has a “delete” marker, it returns a 404 error
5) You can get previous versions by specifying an ID
Cloud Formation: Template Sections
1) AWSTemplateFormatVersion
2) Description
3) MetaData
4) Parameters
5) Mappings
6) Conditions
7) Resources
8) Outputs
DynamoDB: Scans (benefits)
1) Scans can apply filters to the results to refine values
2) Can return only specific attributes with the “ProjectionExpression” parameters
S3: IAM Policies
1) User policy
2) Can create multiple users and give them the same policy or different policies
3) Policies are attached and can be detached
4) Cannot grant anonymous permissions
Intrinsic Functions: FN::Select
1) Returns a single object from a list of objects by index
S3: Eventual Data Conistancy
1) State reads possible
2) Lowest read latency
3) Highest read throughput
S3 Performance: GET Intensive workloads
1) Use Cloud Front
- Distributes content with lower latency & high transfer rate
- Cache objects
- Fewer direct request to S3
Cognito Sync
1) Sync data across mobile devices and the web
2) Client libraries cache data locally
DynamoDB: ALL
Projection Type
1) All attributes are projected (biggest index - least performant
SWF: Workers
1) Process that performs an activity that is part of the workflow
2) Workers poll SWF for new tasks that they need to perform
3) After receiving a task, the worker will process the task however it is instructed to do so, then report back to SWF
4) Workers CAN consist of a server (code being executed), a human worker can also be used to process as task
DynamoDB: Features
1) Can be used with (via) the AWS console or API
2) Flexible data model with attributes and items
3) Supports different levels of consistency (eventually & strongly)
4) Conditional updates and concurrency control (automatic counter)
5) Pay for what you use
6) Integrates with monitoring
7) Integrates with AWS Big Data (EMR & Redshift)
8) Integrates with other services through “streams”
SNS: Managing Access
1) Access is controlled with policies
2) SNS has it’s own IAM permissions system
3) You can control:
- Who is allowed to publish a topic
- Who is allowed to subscribe to a topic
- and under what conditions
S3: ACLs
1) Used for both buckets & objects
2) Grant read/write permissions to other AWS accounts
3) You cannot grant conditional permissions
4) you cannot explicitly deny permissions
5) An object ACL is the only way to manage access to objects not owned by the bucket owner
6) Uses XML format
S3: URL
1) Every hosted bucket receives it’s own URL
.S3-website-.amazonaws.com
SQS: Core Features
1) Redundant infrastructure
2) Multiple writes & reads
3) Queues can be configured
4) Access Control
5) Delay queues (0-15 seconds)
6) PCI compliant
Cloud Formation: Mappings
1) Lets you map keys to values
DynamoDB: Partition Key
1) A type of primary key
2) Also known as a “hash attribute”
3) Simple primary key composed of an attribute
4) Used to retrieve data
5) Must be unique
Intrinsic Functions: Ref
1) Returns a resource or value based on a logical name or parameter
Error 409
Error 409 = Conflict
1) S3 Bucket already exist
2) Bucket is not empty (when trying to delete)
3) Bucket name already taken
SQS: Message Lifecyle
1) Component “1” sends message “A” to a queue, and then the message is redundantly distributed across SQS servers
2) When component “2” is ready, it retrieves the message from SQS. While message “A” is being processed it remains in the queue, but “Visibility Timeout”
3) Component “2” deletes the message from the queue during that “Visibility Timeout” or it will get deleted
SNS: Access Control Policies
1) The AWS account owner had the only permissions by default
2) ALLOWS override default DENIES
3) Explicit DENIES override ALLOWS
4) Order of policies does NOT matter
5) Can grant access to another account API call “AddPermission”
S3: AWS Limits/Restrictions
1) AWS account can have up to 100 S3 buckets
2) No limit on the number of objects
3) Bucket name must:
- Be a min of 3 characters and a max of 63
- Can only contain lowercase letter, numbers, periods & hyphens
- Must start with a letter or number
- Periods & hyphens cannot follow each other
- Can’t be an an IP address
DynamoDB: Primary Key
1) Is a unique identifier for each ITEM in a table
2) No two items can have the same key
S3: Restoring Version Objects
1) Any earlier version can be restored by:
- Copying a previous version into the same bucket will restore it as the current version
- Permanently deleting the current version
- Copying an earlier version GETs the version and PUTs it in the bucket, giving it a new ID (the new ID is used as current version)
DynamoDB: Queries
1) Allows you to find items using ONLY primary key-values from a table OR secondary index
2) more efficient then SCAN
DynamoDB: INCLUDE
Projection Type
1) Only specified attributes are projected
AMI API: “RegisterImage”
1) Occurs during the FINAL process of creating an AMI
Error 404
Error 404 = Not found
1) Bucket does not exist
2) Key does not exist
SNS Message Data: TopicARN
ARN = Amazon Resource Name
1) ARN fro the topic that this message was published to
Federation (mobile apps)
1) Use
-Facebook
-Amazon
-Google
To authenticate mobile app users and then grant access to temp resources
SQS API: “ChangeMessageVisibility”
1) Changes a messages Visibility Timeout
2) Adds specified time to current remaining time
*Note: Visibility Timeout can be 0-12 hours
Amazon Cognito
1) Creates unique identity for users
2) Authenticates identities with identity providers
3) Supports unauthenticated identities (anonymous)
4) Saves mobile user data
5) Uses credentials obtained to sync data with Cognito sync
SNS Message Data: Subject
1) Subject Parameter
2) Optional parameter
SNS Message Data: Message
1) Message value specified when the notification was published to the topic
2) A string that describes the message
S3: Versioning
1) Allows multiple versions of an object
2) Protects against unintended overwrites and deletions
3) Automatically archives objects
4) Versioning is at the BUCKET LEVEL
5) Configured via console or SDK
6) “off” by default
SNS Message Data: MessageID
1) Universally Unique Identifiers (UUID)
2) Same ID must be used for retries
S3: Bucket Policies
1) Resource-based policy
2) Created via JSON
3) Can grant other AWS accounts or IAM users permissions for the bucket/object
4) SHOULD be used to manage cross-account permissions for all S3 permissions
5) Limited to 20kb in size
DynamoDB: Scans (negatives)
1) The larger the data set in the table, the slower the performance of a scan
2) The more filters on the scan, the slower the performance
3) Return only filtered results
4) Only eventually consistent reads available
SQS: Advantages
1) Components are loosely coupled (decoupled) for high availability, reliability, and scalability
2) Protects against losing data on application failure
DynamoDB: Exceeding Throughput
1) Request exceeding the allocated throughput may be throttled
2) With Global Secondary Indexes, all indexes must have enough Write Capacity OR the write might get throttled (even if the write doesn’t effect index)
3) You can monitor throughput in the AWS Console