S3 Flashcards
How resilient is s3?
It is stored in single region and in multiple AZ therefore it is regional resilient.
What are logical units for S3?
Bucket - container for objects
- can contain unlimited number of objects
- soft limit 100 buckets
- hard limit 1000 buckets
- bucket name is unique globally and 3-63 chars, lowercase, no underscore, start with az01, cant be in ip address format
Object - a single unit that contains file
- can contain 0 - 5tb size of objects
- have version id, metadata, access control, sub resources (acl)
What is object versioning and how it works?
Each object inserted in s3 has their own versionId.
- New objects do not rewrite old objects, but sort of pushed on top of the stack.
- When deleting object delete marker is inserted (nothing is deleted), to actually delete object it is required to reference by versionId.
Once versioning is enabled it cannot be disabled.
Bucket versioning have 3 states:
- suspended state - create/replace objects with null state
- disabled state - create/replace objects with null state
- enabled state - for each object new version is generated
When getting object with no version specified - latest object is retrieved.
When not to use S3?
When filesystem is required:
- mounting a disk
- block storage (s3 is object storage and cannot append file, etc)
What s3 bucket policy is used for?
It is resource policy and determines:
- which identities can access which object
- which actions these identities can execute
What is ACL?
Access Control List is legacy mechanics to change access for bucket and objects inside.
Allows to set - write, read, read_acp (allow read acl for object), write_acp (allows write acl for object), full control
Why there is Block Public Access banner?
It is failsafe for misconfiguration to give access to anonymous identities access to s3 bucket.
What is s3 static hosting?
Provides public access to a bucket using http.
- Specify index.html and error.html files.
- Automatically creates dns name to access the bucket
How to speed up upload to s3?
Use multipart upload to s3:
- it opens multiple tcp streams
- it finds closest edge location to upload a file
- it splits files in chunks to upload in parallel
- it retries upload if one of the chunks fail to upload
- min file size is 100mb
- part size can be from 5mb to 5gb and 10k files
What are types of s3 encryption?
- SSE-C - customer provided keys. When uploading file user provided encryption keys.
- SSE-S3 - s3 managed keys (AES 256) when uploading file, s3 uses S3 KMS keys to enc/dec.
- SSE-KMS - s3 speaks with KMS to retrieve enc/dec key
How SSE-C works?
SSE-C - Customer provided keys.
- When uploading/downloading file customer provides enc key.
- When uploading hash of the key is taken and appended to file.
- When downloading hash of the key is compared with appended key hash.
How SSE-S3 works?
SSE-S3 S3 Managed keys (AES 256)
- S3 manages its own enc keys in KMS
- User has no control over the keys used
- Each object is encrypted with a different key
- Each key is encrypted with the root key and stored in s3
How SSE-KMS works?
SSE-KMS
- Uses customers specified KMS key
- Each object is encrypted with different key
- Each key is encrypted with the root key and stored in s3
- User can do role separation - enc, dec, admin
- User can do root key rotation
What are the storage classes and how they differ?
Pricing: GB/m + transfer per GB + request count
https://aws.amazon.com/s3/storage-classes/
- s3 standard (default) - 3 az, retrieval in ms
- s3 standard IA (infrequent access) - 3 az, min contract 30 days, min file size 128kb, retrieval in ms
- s3 one zone IA - 1 az, contract 30 days, min file size 128kb, retrieval in ms
- s3 glacier instant retrieval - 3 az, contract 90 days, min file size 128kb, retrieval in ms
- s3 glacier flexible retrieval - 3 az, contract 90 days, min file size 40kb, retrieval in minutes to hours
- s3 glacier deep archive - 3 az, contract 180 days, min file size 40kb, retrieval in hours
- s3 intelligent tiering - pricing for monitoring, moves between tiers
What is s3 lifecycle configuration and how it works?
- Consists of set of rules.
- Rules consist of actions.
- Apply on buckets or group of objects
Transition actions - moves objects between tiers
- transition only happens in downwards direction
- objects must be in their tier for 30 days before action applies
- can delete objects once ttl expires