AWS S3(1) - 개요
1. Section introduction
Amazon S3 is one of the main building blocks of AWS
⇒ AWS S3는 AWS에 있어 가장 메인이 되는 저장소 요소이다
It’s advertised as ”infinitely scaling” storage
⇒ 무한히 확장가능한 스토리지로 알려져있다
Many websites use Amazon S3 as a backbone
⇒ 많은 웹사이트들이 AWS S3를 중추로써 사용하고 있다
Many AWS services use Amazon S3 as an integration as well
⇒ 많은 AWS 서비스들은 Amazon S3를 통합수단으로서 사용한다
2. Amazon S3 Use cases
- 백업 그리고 스토리지로 사용
- 재해복구
- 아카이빙
- 하이브리드 클라우드 스토리지
- 앱 호스팅
- 미디어 호스팅
- 데이터 레이크 및 빅데이터 분석
- 소프트웨어 전달
- 고정 웹사이트
3. Amazon S3 - Buckets
Amazon S3 allows people to store objects (files) in “buckets” (directories)
⇒ AWS S3는 “buckets”이라는 곳에 파일 및 오브젝트들을 저장할 수 있도록 한다
Buckets must have a globally unique name (across all regions all accounts)
⇒ 버켓이름은 반드시 고유한 이름이어야한다. (Region을 통틀어서 고유해야한다)
Buckets are defined at the region level
⇒ 버켓은 region 차원을 기준으로 정의된다
S3 looks like a global service but buckets are created in a region
⇒ S3는 global 서비스인것 같지만, 실제로는 한 region에서만 생성된다
네이밍 룰
- 대문자 X, 언더바 X
- 3 ~ 63 길이의 문자열 스트링
- IP주소 안됨
- 숫자나 소문자로 시작해야함
- “xn”으로 시작해서는 안된다
- “s3alias”로 끝나서는 안된다
4. Amazon S3 - Objects
Objects (files) have a Key
⇒ object(파일)은 키를 가진다
- The key is the FULL path:
- s3://my-bucket/my_file.txt
- s3://my-bucket/my_folder1/another_folder/my_file.txt
- The key is composed of prefix + object name
- s3://my-bucket/my_folder1/another_folder/my_file.txt
There’s no concept of “directories” within buckets (although the UI will trick you to think otherwise)
⇒ bucket에 있어 디렉토리라는 개념이 없다
Just keys with very long names that contain slashes (“/”)
⇒ 그저 단순히 긴 이름일때는 “/” 문자가 붙을 뿐이다
- Object values are the content of the body:
Max. Object Size is 5TB (5000GB)
⇒ 최대 Object 사이즈는 5TB이다
If uploading more than 5GB, must use “multi-part upload”
⇒ 만약 5GB 이상 업로드 시, 반드시 “multi-part upload”를 사용해야한다
Metadata (list of text key / value pairs – system or user metadata)
⇒ 메타데이터 (텍스트 키 / 값 pair - 시스템 또는 사용자에 대한 메타데이터)
Tags (Unicode key / value pair – up to 10) – useful for security / lifecycle
⇒ 태그 (유니코드 키/ 값 pair - 최대 10개까지) - security / lifecycle에 유용
Version ID (if versioning is enabled)
⇒ 버전 ID (버전설정이 활성화 된 전제하에)
5. Amazon S3 – Security
- User-Based (사용자 기반)
- IAM Policies – which API calls should be allowed for a specific user from IAM
- Resource-Based (리소스 기반)
- Bucket Policies – bucket wide rules from the S3 console - allows cross account
- Object Access Control List (ACL) – finer grain (can be disabled)
- Bucket Access Control List (ACL) – less common (can be disabled)
- Note: an IAM principal can access an S3 object if (IAM pricipal은 아래 상황일때 S3 object 접근 가능)
- The user IAM permissions ALLOW it OR the resource policy ALLOWS it
- AND there’s no explicit DENY
- Encryption(암호화) : encrypt objects in Amazon S3 using encryption keys
6. S3 Bucket Policies
- JSON based policies (JSON 기반의 policy)
- Resources: buckets and objects
- Effect: Allow / Deny
- Actions: Set of API to Allow or Deny
- Principal: The account or user to apply the policy to
- Use S3 bucket for policy to (policy를 위한 S3 bucket 사용)
- Grant public access to the bucket
- Force objects to be encrypted at upload
- Grant access to another account (Cross Account)
7. Bucket settings for Block Public Access
These settings were created to prevent company data leaks
⇒ 이 설정들은 데이터 누수를 막기위해 만들어 졌다
If you know your bucket should never be public, leave these on
⇒ 사용자의 bucket이 public이 되지 않는다면, “on”상태로 그대로 냅둘것
Can be set at the account level
⇒ 일반계정 레벨에서 설정 가능
8. Amazon S3 – Static Website Hosting
S3 can host static websites and have them accessible on the Internet
⇒ S3는 고정 website 호스팅이 가능하고 인터넷상에서 연결 가능하도록 할수 있다
- The website URL will be (depending on the region)
- http://bucket-name.s3-website-aws-region.amazonaws.com OR
- http://bucket-name.s3-website.aws-region.amazonaws.com
If you get a 403 Forbidden error, make sure the bucket policy allows public reads!
⇒ 403 Forbidden 발생시, bucket policy를 public read로 바꾸고 진행할 것
9. Amazon S3 - Versioning
You can version your files in Amazon S3
⇒ AWS S3에서 파일 버저닝이 가능하다
It is enabled at the bucket level
⇒ bucket 레벨단에서 활성화 가능하다
Same key overwrite will change the “version”: 1, 2, 3….
⇒ 같은 key가 overwrite 되면서 version 1,2,3으로 변화할 것이다
- It is best practice to version your buckets
Protect against unintended deletes (ability to restore a version)
⇒ 의도치 않은 삭제를 방지한다 (버전 복구 기능)
Easy roll back to previous version
⇒ 이전 버전으로의 roll back이 쉽다
- Notes:
Any file that is not versioned prior to enabling versioning will have version “null”
⇒ 버저닝이 되지 않은 완전 최초의 파일의 경우 “null” 버전으로 표시된다
Suspending versioning does not delete the previous versions
⇒ “Suspending versioning” 설정은 이전 버전을 지우지 않는다
10. Amazon S3 – Replication (CRR & SRR)
Must enable Versioning in source and destination buckets
⇒ 반드시 Versioning을 설정하고, 타겟 버켓을 지정한다
Cross-Region Replication (CRR)
⇒ Cross-Region 복제 (지역 건너 복제)
Same-Region Replication (SRR)
⇒ Same-Region 복제 (동일 지역 복제)
Buckets can be in different AWS accounts
⇒ Bucket은 AWS 계정마다 달라질 수 있다
Copying is asynchronous
⇒ 비동기식 Copying 이다
Must give proper IAM permissions to S3
⇒ 반드시 적절한 IAM 권한부터 S3에게 주어야 한다
Use cases:
- CRR – compliance, lower latency access, replication across accounts
- SRR – log aggregation, live replication between production and test accounts
11. Amazon S3 – Replication (Notes)
After you enable Replication, only new objects are replicated
⇒ Replication을 활성화하고 나면, 오직 새로운 object만이 복제된다
Optionally, you can replicate existing objects using S3 Batch Replication
⇒ 옵션에 따라, S3 Batch 복제를 이용하여 이미존재하는 object의 복제도 가능하다
Replicates existing objects and objects that failed replication
⇒ 이미 존재하는 object와 복제실패한 object를 복제한다
- For DELETE operations (DELETE 기능)
Can replicate delete markers from source to target (optional setting)
⇒ delete markers를 source에서 target으로 복제 가능하다 (옵션설정)
Deletions with a version ID are not replicated (to avoid malicious deletes)
⇒ version ID가 포함된 삭제는 복제되지 않는다 (악의적 삭제를 막기 위함)
- There is no “chaining” of replication (체이닝 복제 기능이 없다)
If bucket 1 has replication into bucket 2, which has replication into bucket 3
⇒ 버킷 1에서 버킷 2로의 복제가 있고, 버킷 2에서 버킷 3으로의 복제가 있다고 했을 때
Then objects created in bucket 1 are not replicated to bucket 3
⇒ bucket1에 생성된 object는 bucket3에는 복제되지 않는다
12. S3 Storage Classes
- Amazon S3 Standard - General Purpose
- Amazon S3 Standard-Infrequent Access (IA)
- Amazon S3 One Zone-Infrequent Access
- Amazon S3 Glacier Instant Retrieval
- Amazon S3 Glacier Flexible Retrieval
- Amazon S3 Glacier Deep Archive
- Amazon S3 Intelligent Tiering
Can move between classes manually or using S3 Lifecycle configurations
⇒ 클래스들 사이에서 이동이 가능하거나 또는 S3 라이프사이클 설정을 이용할 수 있다
13. S3 Durability and Availability
- Durability (내구성)
High durability (99.999999999%, 11 9’s) of objects across multiple AZ
⇒ 다중 AZ를 초월하는 고성능의 내구도
If you store 10,000,000 objects with Amazon S3, you can on average expect to incur a loss of a single object once every 10,000 years
⇒ Amazon S3에 10,000,000개의 객체를 저장하는 경우 평균적으로 10,000년에 한 번씩 단일 객체의 손실이 발생할 것으로 예상
Same for all storage classes
⇒ 모든 스토리지 클래스가 같다
- Availability (가용성)
Measures how readily available a service is
⇒ 현재 준비된 가용서비스들이 몇개인지 측정
Varies depending on storage class
⇒ 스토리지 클래스에 따른 다양한 의존성
Example: S3 standard has 99.99% availability = not available 53 minutes a year
⇒ 예시 : S3 스탠다드는 거의 99.99% 가용성을 가진다 = 1년에 53분정도 가용이 불가하다
14. S3 Standard – General Purpose
99.99% Availability
⇒ 99.99% 가용성
Used for frequently accessed data
⇒ 빈번하게 접근되는 데이터에 사용됨
Low latency and high throughput
⇒ 저 지연율의 고성능 처리량
Sustain 2 concurrent facility failures
⇒ 2개의 기능적 결함을 지속
Use Cases: Big Data analytics, mobile & gaming applications, content distribution…
⇒ 빅데이터 분석, 모바일 & 게임 어플, 컨텐츠 분산
15. S3 Storage Classes – Infrequent Access
For data that is less frequently accessed, but requires rapid access when needed
⇒ 거의 접근되지 않는데이터에 쓰이나, 필요시 재빠른 접속이 필요한 것일때 사용
- Lower cost than S3 Standard (S3 스탠더드 보다는 저비용)
- Amazon S3 Standard-Infrequent Access (S3 Standard-IA)
99.9% Availability
⇒ 99.9% 가용성
Use cases: Disaster Recovery, backups
⇒ 재해복구 및 백업
- Amazon S3 One Zone-Infrequent Access (S3 One Zone-IA)
High durability (99.999999999%) in a single AZ; data lost when AZ is destroyed
⇒ 단일 AZ에서의 고성능 내구도 : 즉 AZ가 파괴되면 데이터가 손실
99.5% Availability
⇒ 99.5% 가용성
Use Cases: Storing secondary backup copies of on-premises data, or data you can recreate
⇒ 사용 예시 : 온프레미스 데이터의 두번째 백업본 저장 또는 사용자가 재생성한 데이터
16. Amazon S3 Glacier Storage Classes
Low-cost object storage meant for archiving / backup
⇒ 저비용 object 스토리지란 아카이빙 및 백업에 사용되는것을 의미
Pricing: price for storage + object retrieval cost
⇒ 스토리지 비용 + object 검색 비용이 전체 비용
- Amazon S3 Glacier Instant Retrieval
- Millisecond retrieval, great for data accessed once a quarter (ms단위 검색, 분기에 한번 데이터 접근에 유용)
- Minimum storage duration of 90 days (90일동안 미니멈 스토리지 사용가능)
- Amazon S3 Glacier Flexible Retrieval (formerly Amazon S3 Glacier):
- Expedited (1 to 5 minutes), Standard (3 to 5 hours), Bulk (5 to 12 hours) – free
- Minimum storage duration of 90 days (90일동안 미니멈 스토리지 사용가능)
- Amazon S3 Glacier Deep Archive – for long term storage:
- Standard (12 hours), Bulk (48 hours)
- Minimum storage duration of 180 days (180일동안 미니멈 스토리지 사용가능)
17. S3 Intelligent-Tiering
Small monthly monitoring and auto-tiering fee
⇒ 적은 개월 단위의 모니터링과 자동 티어링 요금
Moves objects automatically between Access Tiers based on usage
⇒ object를 사용중인 Access Tier 사이에 자동적으로 이동
There are no retrieval charges in S3 Intelligent-Tiering
⇒ S3 Intelligent-Tiering에서는 검색에대한 비용을 내지 않아도 됨
- Frequent Access tier (automatic): default tier
- Infrequent Access tier (automatic): objects not accessed for 30 days
- Archive Instant Access tier (automatic): objects not accessed for 90 days
- Archive Access tier (optional): configurable from 90 days to 700+ days
- Deep Archive Access tier (optional): config. from 180 days to 700+ days