Computer/AWS

[AWS Certified Cloud Practitioner] 06. S3

SenJ 2022. 1. 31. 09:36

AWS S3 : Simple Storage Service 의 약자로 파일서버의 역할을 하는 서비스

- Object(=파일)를 Bucket(=디렉토리)에 저장할 수 있도록 한다

- Buckets은 글로벌로 유니크한 이름을 가진다. (모든 리젼 모든 계정) -> 글로벌 서비스로 보이지만 리젼단위로 생성된다.

- Backup and storage / Disaster recovery / Archive / Hybrid cloud storage / App hosting/ Media hosting / Data lakes & Big data analytics / Software delivery / Static website

- 네이밍 규칙 : 대문자 x, 언더바 x, 3-63 캐릭터, IP 주소 x, 소문자 또는 숫자로 시작해야함

Objects : 저장된 객체 (=파일), 키는 하나의 경로로서 prefix+객체명으로 이루어진다. (슬래시도 포함됨)

- Buckets은 디렉토리와 닮아있지만 디렉토리로서의 개념은 아님

- 객체는 최대 5TBs 의 body를 가지며 5GB이상 업로드를 하기 위해서는 multi-part upload 를 해야함

- Metadata : key/value pair 시스템 또는 사용자의 메타데이터임

- Tags (Unicode key /value pair - up to 10) 보안과 라이프사이클에 유용

- Version ID

S3 Security

- User based : IAM policies – API 호출은 IAM console상에서 특정사용자 허용이 필요함

- Resource Based

1. Bucket policies – Bucket wide rules from the S3 console, 모든 계정에 대한 권한 부여

2. Object Access Control List(ACL) – finer grain

3. Bucket Access Control list(ACL) - 일반적이지 않음

- IAM Principal 가 S3 object 접근 가능한 경우 : 사용자 IAM permissions 허용하는 경우 또는 resource policy 가 허용하는 경우, 그리고 DENY 명시적으로 설정되어있지 않은 경우

- Encryption : 암호화된 객체는 Encryption keys 를 사용

접근주체별 시큐리티 설정

- Anonymous -> S3 bucket(S3 bucket policy)

- IAM user (IAM policy) -> S3 bucket

- EC2 instance ( EC2 instance role, IAM permissions) -> S3 bucket

- IAM user other AWS account -> S3 bucket(S3 bucket policy)

S3 Bucket policies

- JSON 문서

- S3 Bucket policy 를 통해 퍼블릭 어세스 허용, 파일 업로드시 암호화를 강제하며 다른 계정에게도 어세스 허용

S3 Websites

- Static websites 를 호스팅하여 www상에서 접근가능

- 403(Forbidden) error의 경우 Bucket policy 의 public reads 확인 필요

S3 Versioning

- Amazon S3 의 객체의 버젼을 설정할 수 있음

- Bucket 단계에서 설정가능

- 같은 키에서 1,2,3 .. 순으로 버젼관리

- 롤백이 필요한 경우 유용하게 사용가능

- 이전에 버젼설정이 되지 않은 경우 새버젼이 생기면 버젼번호가 “null”로 설정됨

- Versioning을 제거하더라도 이전 버젼이 삭제되지 않음

S3 Access logs : S3 buckets의 모든 계정에서 모든 종류의 접근을 로그로 남길 수 있음 -> 또 다른 S3 bucket으로 남김

S3 Replication (CRR&SRR) : 해당 소스와 목적지에 Versioning 설정이 필수. 다른 계정으로도 가능, 비동시적인 복사가 일어남, 적절한 IAM permissions 이 필요함

- Cross Region Replication(CRR):compliance, lower latency access, replication across accounts

- Same Region Replication(SRR): log aggregation, live replication between production and test account

S3 Storage Classes

- Amazon S3 Standard - General purpose : 99.99% 가용성, 데이터에 빈번한 접근이 있을 경우 사용, 저지연 고처리율, Sustain 2 concurrent facility failures, ex) big data analytics, mobile&gaming applications, content distribution

- Amazon S3 Standard - Infrequent Access(IA) : 접근이 적지만 필요시 빠르게 접근이 필요한 데이터에 알맞음, 99.99% 가용성, Genral purpose에 비해 비용이 저렴하지만 Retrieval fee 가 있음, sustain 2 concurrent facility failures, ex) data store for disaster recovery, backups

- Amazon S3 One Zone -Infrequent Access(IA) : Standard IA와 동일하지만 하나의 AZ에 보존된다, 99.5%의 가용성, 저지연 고처리율, Standard IA 에 비해 20%정도 저렴, ex) storing secondary backup copies of on-premise data or storing data you can recreate

- Amazon S3 Intelligent Tiering : 99.9% 가용성, 저지연 고처리율, 사용패턴에 의거해 자동적으로 오브젝트를 FA/IA 로 구분하여 비용최적화됨, AZ에 발생하는 문제에 대해 회복력이 좋음

- Amazon S3 Glacier & Glacier Deep Archive : 저비용 스토리지 (in GB/month ) Archiving / Backup 에 유용, 긴 기간 보존, 다양한 Retieval 옵션(시간 + Retrieval fee)

Glacier : cheap, expedited(1~5mins), standard(3~5 hours, bulk(5~12 hours)

Glacier Deep Archive : cheapest, standard(12 hours), bulk(48 hours)

- Amazon S3 Reduced Redundancy Storage

Durability and Availability

- Durability : high durability of objects across multiple AZ, same for all storage classes

- Availability : measures how readily available a service is, varies depending on objects

S3 Object lock

- WORM 모델(Write Once Read Many), 오브젝트 버젼 삭제를 일정기간 블락함

Glacier Vault lock

- WORM 모델(Write Once Read Many), 미래의 수정에 대해서 락을 걸어둠, 컴플라이언스 및 데이터 유지에 유용

S3 encryption

- No encryption / Server-side Encryption / Client-side encryption

Responsibility

-AWS : infra, configuration and vulnerability analysis, compliance validation

-User :S3 versioning, S3 bucket policies, S3 replication setup, logging and monitoring, S3 storage classes, data encryption at rest and in transit, 사용 서비스의 정보보호 및 관리

AWS Snow Family : 고보안, 물리적 디바이스로 어떠한 네트워크 환경에서도 데이터를 수집 및 프로세싱할 수 있음, 이후 AWS 마이그레이션 가능

- Data migration : Snowcone, Snowball edge, Snowmobile

- Edge computing : Snowcone, Snowball edge

- AWS Snow Family 사용 순서

1. Request snowball devices from the aws console for delivery

2. Install the snowball client /AWS opshub on your servers

3. Connect the snowball to your servers and copy files using the clients

4. Ship back the device when you’re done

5. Data will loaded into an S3bucket

6. Snowball is completely wiped

Snowball Edge(for data transfers)

- 물리적 데이터 전송 장치 : AWS-장치간 TBs ~ PBs 데이터 이동

- 네트워크 없이 데이터 전송할 수 있는 대안, 전송작업별로 비용지불

- Block storage, Amazon S3-compatible object storage 제공

- Snowball Edge Storage Optimized : 80TB of HDD capacity for block volume and S3 compatible object storage

- Snowball Edge Compute Optimized : 42TB of HDD capacity

- ex) large data cloud migrations, DC decommission ,disaster recovery

AWS Snowcone

- 작고 휴대성이 편리(4.5punds)하며 어느환경에서도 버틸 수 있음

- Edge computing, storage and data transfer

- 8TBs of usable storage

- Snowball을 사용할 수 없는 환경에 사용하기 좋음

- 직접 배터리 / 케이블 소지해야함

- AWS offline으로 전송 및 온라인상에서 데이터 싱크를 맞출 수 있음

Snowmobile (트럭같은 거임)

- 엑사바이트 데이터 전송( 1 EB = 1000PB, 1000000TBs)

- 각 Snowmobile 은 100PB 의 용량이 있으며 병렬로 사용가능

- 보안성이 높고 온도 조절, GPS, 보안카메라 등이 탑재됨

- 10PBs 이상을 전송 및 사용할 때 Snowball 보다 좋음

Edge Computing : 제한된 환경에서의 데이터 프로세싱 등, 네트워크 접속이 원할하지 않은 경우 해당 장비들을 사용하여 데이터 프로세싱 후 AWS에 마이그레이션 가능, EC2 인스턴스 구동 및 AWS lambda 기능사용가능 (using AWS IoT Greengrass), 장기계약의 경우 할인옵션이 있음

ex) preprocess data, machine learning at the edge, transcoding media streams

Snowcone (smaller)

- 2CPUs, 4GB of memory, wired or wireless access, USB-C power

Snowball Edge - Compute optimized

- 52 vCPUs, 208 GiB of Ram, optional GPU(useful for video processing or machine learning), 42TB usable storage

Snowball Edge - Storage optimized

- Up to 40 vCPUs, 80 GiB of RAM, object storage clustering available

AWS OpsHub : 과거에는 CLI -> 현재는 AWS OpsHub

AWS Storage Cloud Native Options

-Block : Amazon EBS, EC2 Instance store

-File : Amazon EFS

-Object :Amazon S3, Glacier

AWS S3 Gateway : 하이브리드 클라우드 구축을 위한 온프레미스-오프프레미스 연결허브

출처 : Udemy Ultimate AWS Certified Cloud Practitioner - 2022