SAA-C02 Storage services S3 and Cloudfront

Summary

Use Cases

S3: software distribution, backup, images, media, static websites EBS: Op system for EC2. Databases. Trans logs. Low latency. Format files. Same AZ as needs to be close. EFS: Corporate directories, data analytics. Can be diff AZs. Multiple AZ. Mount it.

S3

Global service, but buckets in a region. Data held in the region. Name globally unique. Rest interface

Durability: prob that an object will not be lost Availability: prob that will be available.

Provides read after write consistency for puts of new objects Provides eventual consistence for overwrite puts and deletes (takes time to propagate)

Prefix mimics folder. 100 buckets per account. No bested buckets but have folders. Max file size 5Tb

S3 CLI

aws s3 ls
aws s3 ls s3://jer-saa-bucket
aws s3 cp file bucket
aws s3 rm s3://bucket/file

Regions

S3 is global
Name must be unique
but data is stored in a region

S3 storage classes

Create an S3 endpoint

S3 is public so can't access it from private subnet.
Set up S3 gateway endpoint.
It's a gateway type, so need to put entries in route table.

Security

Policy setup

Policy written in JSON to set identifier, action, effect, resource.
Can apply a policy 2 different ways:

To identify resources, use Amazon Resource Name (ARN): this is unique for all types of resources (Users, buckets etc)

Cross account access

Access control lists (ACL)

Policy simulator, Access advisor

Tools to let you set up policies more easily.
See where permissions come from.

Use cases for ALC:

Other use cases are for resource or identify based policies.

Multipart upload

Query string authentication

aws s3 presign [filename]

Other S3 tools

Transfer Acceleration

Static websites

Versioning

MFA delete

Multi factor to delete.

Cross region replication (CRR)

Automatically does it cross AZs
But can choose to asynchronously copy data between regions.

Use cases

Need to have versioning enabled.
S3 needs to have role permissions to replicate the bucket.

Lifecycle management

If you don't know the lifecycle, use intelligent tiering.

pricing

S3 encryption

Encrypt on server side or client side

server side: use s3 keys (SSE-s3) or your key (SSE-KMS), or SSE-C (client provided keys).
client side: you encrypt before sending, S3 knows nothing

when switch on only covers new objects

Events and notifications

Based on event types, e.g. POST, COPY, DELETE etc
Send to SNS, SQS, Lambda etc

For SNS, create a topic, subscribe to it.

Requestor pays

Server access logging

Object lock

S3 select, glacier select

performance considerations

Cloudfront

S3 static website and cloudfront

cloudfront cache behaviors: say how to respond to different requests.

Lambda edge functions

run a function at the cache, logic closer to users.