AWS S3 실습
Public S3 버킷 생성
S3
에서 버킷 만들기
클릭
![스크린샷 2021-07-02 오후 10 02 47](https://user-images.githubusercontent.com/86812249/124284576-16d49d80-db88-11eb-905c-8fa6d4acdf60.png)
이름: 유니크한 걸로 ! (icebear-afos-s3로 바꿨습니다.), 모든 퍼블릭 액세스 차단
해제 후, 하단에 현재 설정으로 인해 ~
체크해주기
![스크린샷 2021-07-02 오후 10 03 00](https://user-images.githubusercontent.com/86812249/124284585-1805ca80-db88-11eb-865f-d54125b888cd.png)
![스크린샷 2021-07-02 오후 10 03 13](https://user-images.githubusercontent.com/86812249/124284596-19cf8e00-db88-11eb-929b-81db2d36b905.png)
버킷 만들기
클릭
![스크린샷 2021-07-02 오후 10 03 24](https://user-images.githubusercontent.com/86812249/124284602-1b00bb00-db88-11eb-89f4-54fba4cad937.png)
만든 버킷 안에 들어가서 업로드
클릭
![스크린샷 2021-07-02 오후 10 04 10](https://user-images.githubusercontent.com/86812249/124284603-1b00bb00-db88-11eb-8f8a-650fbea971b1.png)
업로드할 사진 올려주기 ! (아무 사진)
![스크린샷 2021-07-02 오후 10 04 28](https://user-images.githubusercontent.com/86812249/124284605-1b995180-db88-11eb-989d-1a315d957cdc.png)
업로드
클릭
![스크린샷 2021-07-02 오후 10 04 42](https://user-images.githubusercontent.com/86812249/124284610-1b995180-db88-11eb-9ff1-368c703e7a14.png)
짜쟌
![스크린샷 2021-07-02 오후 10 05 19](https://user-images.githubusercontent.com/86812249/124284615-1cca7e80-db88-11eb-922a-344f2eba5138.png)
파일에 들어가서 객체 URL
를 복사해 웹으로 접속하면
![스크린샷 2021-07-02 오후 10 05 48](https://user-images.githubusercontent.com/86812249/124284618-1cca7e80-db88-11eb-878f-987f73a0cb99.png)
접근 거부가 된다. 다른 사람이 볼 수 있게 설정해 줘야 한다.
![스크린샷 2021-07-02 오후 10 06 48](https://user-images.githubusercontent.com/86812249/124284627-1dfbab80-db88-11eb-86ac-88f965ffef6c.png)
사진을 클릭 후에, 작업
을 눌러서 퍼블릭으로 설정
을 눌러주자
![스크린샷 2021-07-02 오후 10 05 12](https://user-images.githubusercontent.com/86812249/124284613-1c31e800-db88-11eb-91f0-988ac3bf6245.png)
하단에 퍼블릭 설정
을 눌러주자
사진이 드디어 보입니다 !
![스크린샷 2021-07-02 오후 10 06 01](https://user-images.githubusercontent.com/86812249/124293490-b0ed1380-db91-11eb-9c10-ce6efe18bae5.png)
사진에 들어가서 객체 URL를 복사한다.STG1 인스턴스
에 들어가서 웹서버의 index.html
파일을 수정
1 |
|
![스크린샷 2021-07-02 오후 10 10 27](https://user-images.githubusercontent.com/86812249/124284640-1fc56f00-db88-11eb-8a0d-6d07c2dc906f.png)
![스크린샷 2021-07-02 오후 10 09 18](https://user-images.githubusercontent.com/86812249/124284632-1e944200-db88-11eb-815d-18d42d899adf.png)
![스크린샷 2021-07-02 오후 10 11 15](https://user-images.githubusercontent.com/86812249/124284641-1fc56f00-db88-11eb-810c-5e401b0f8762.png)
EC2
-> 인스턴스
에서 퍼블릭 IPv4주소
를 복사하자
![스크린샷 2021-07-02 오후 10 09 54](https://user-images.githubusercontent.com/86812249/124284638-1f2cd880-db88-11eb-8ec2-51debddbae34.png)
성공 !
![스크린샷 2021-07-02 오후 10 11 31](https://user-images.githubusercontent.com/86812249/124293706-e72a9300-db91-11eb-8de7-f74a0cce7e9e.png)
옵션) 지랑하기
S3에서 만든 버킷
-> 업로드
클릭
바다 영상을 올립니다.
업로드
클릭 !
![스크린샷 2021-07-02 오후 10 12 40](https://user-images.githubusercontent.com/86812249/124284649-218f3280-db88-11eb-8d94-082f46bf47fc.png)
이전 사진처럼 퍼블릭으로 설정해줘야 접속이 가능
![스크린샷 2021-07-02 오후 10 12 57](https://user-images.githubusercontent.com/86812249/124284651-2227c900-db88-11eb-8600-bba7ef66a0d8.png)
![스크린샷 2021-07-02 오후 10 13 01](https://user-images.githubusercontent.com/86812249/124284653-2227c900-db88-11eb-8b33-7cf0e683f083.png)
바다.mp4
에 들어가서 객체 URL
복사
성공 ~
옵션 결과)
지금은 11시 20분 .. 제 친구들은 다들 새나라 어린이인가 봅니다
![스크린샷 2021-07-02 오후 11 20 10](https://user-images.githubusercontent.com/86812249/124288402-1a6a2380-db8c-11eb-99a0-dbf21b3869f6.png)
옵션) 객체마다 모든 사람 읽기를 체크
하지 않고 버킷에 객체가 업로드 -> 자동으로 모든 사람 읽기 기능
만든 S3 버킷
에서 권한
클릭
버킷 정책에 편집
클릭
![스크린샷 2021-07-02 오후 10 17 15](https://user-images.githubusercontent.com/86812249/124284669-23f18c80-db88-11eb-8307-027185a79795.png)
정책에 붙여놓기 하기
1 |
|
![스크린샷 2021-07-02 오후 10 17 58](https://user-images.githubusercontent.com/86812249/124284672-248a2300-db88-11eb-81e1-1c49cfd3f0de.png)
변경 사항 저장
클릭
![스크린샷 2021-07-02 오후 10 18 05](https://user-images.githubusercontent.com/86812249/124284676-248a2300-db88-11eb-9608-c15a78a1f873.png)
테스트
사진을 올려주고 ‘업로드’ 클릭
올린 사진에 들어가서 객체 URL
복사 클릭
![스크린샷 2021-07-02 오후 10 20 15](https://user-images.githubusercontent.com/86812249/124284683-25bb5000-db88-11eb-8f08-c67749cdbf34.png)
이제 퍼블릭
을 따로 설정해주지 않아도 됨
![스크린샷 2021-07-02 오후 10 20 27](https://user-images.githubusercontent.com/86812249/124284684-2653e680-db88-11eb-84e1-d5d5b07c6f9a.png)
Private S3 실습) AWS CLI-S3 사용
1 |
|
![스크린샷 2021-07-02 오후 10 20 50](https://user-images.githubusercontent.com/86812249/124284687-2653e680-db88-11eb-8807-685407733dab.png)
![스크린샷 2021-07-02 오후 10 21 48](https://user-images.githubusercontent.com/86812249/124284689-26ec7d00-db88-11eb-902f-f1e6f5387895.png)
![스크린샷 2021-07-02 오후 10 22 23](https://user-images.githubusercontent.com/86812249/124284692-26ec7d00-db88-11eb-9c36-eed250b5d7c0.png)
![스크린샷 2021-07-02 오후 10 23 09](https://user-images.githubusercontent.com/86812249/124284695-27851380-db88-11eb-8447-a7fc637bc21d.png)
![스크린샷 2021-07-02 오후 10 26 22](https://user-images.githubusercontent.com/86812249/124284700-281daa00-db88-11eb-83b2-e143104d0b72.png)
![스크린샷 2021-07-02 오후 10 24 04](https://user-images.githubusercontent.com/86812249/124284699-281daa00-db88-11eb-90f6-078788ed16ae.png)
![스크린샷 2021-07-02 오후 10 26 31](https://user-images.githubusercontent.com/86812249/124284703-28b64080-db88-11eb-86c6-4e67a34c7e96.png)
![스크린샷 2021-07-02 오후 10 26 54](https://user-images.githubusercontent.com/86812249/124284706-28b64080-db88-11eb-8f33-99491c75528f.png)
![스크린샷 2021-07-02 오후 10 27 43](https://user-images.githubusercontent.com/86812249/124284707-294ed700-db88-11eb-9141-b821ea23085d.png)
![스크린샷 2021-07-02 오후 10 27 58](https://user-images.githubusercontent.com/86812249/124284712-29e76d80-db88-11eb-804d-1733e7a3593d.png)
![스크린샷 2021-07-02 오후 10 28 39](https://user-images.githubusercontent.com/86812249/124284715-2a800400-db88-11eb-8d2f-9159776c7a37.png)
옵션) 1분 마다 웹 디렉터리(하위 포함)을 버킷에 업로드(백업)하기 -동기화하기
1 |
|
![스크린샷 2021-07-02 오후 10 31 00](https://user-images.githubusercontent.com/86812249/124284717-2a800400-db88-11eb-9319-2ccbab2545d0.png)
![스크린샷 2021-07-02 오후 10 31 33](https://user-images.githubusercontent.com/86812249/124284721-2b189a80-db88-11eb-9fc8-79f9c308cdaa.png)
![스크린샷 2021-07-02 오후 10 32 29](https://user-images.githubusercontent.com/86812249/124284722-2b189a80-db88-11eb-8c64-53d9fb5d110d.png)
![스크린샷 2021-07-02 오후 10 33 40](https://user-images.githubusercontent.com/86812249/124284726-2bb13100-db88-11eb-8655-0d7812d5c354.png)
옵션) Pre-sign URL 현재 버킷의 객체는 외부에서 접근이 불가능하지만 특정 기간 동안 특정 객체 다운 허용
1 |
|
![스크린샷 2021-07-02 오후 10 34 57](https://user-images.githubusercontent.com/86812249/124284727-2c49c780-db88-11eb-890d-3d865d5c812f.png)
![스크린샷 2021-07-02 오후 10 36 39](https://user-images.githubusercontent.com/86812249/124292227-4daeb180-db90-11eb-9334-20181976d612.png)
위에 링크를 복사해서 접속하면 접속이 된다.
![스크린샷 2021-07-02 오후 10 37 03](https://user-images.githubusercontent.com/86812249/124292235-51423880-db90-11eb-965c-3b72618b3896.png)
그럼 s3 객체 URL은 접속이 되나 ?
Private 버킷
에 들어가서 presigned.txt
를 클릭
![스크린샷 2021-07-02 오후 10 35 33](https://user-images.githubusercontent.com/86812249/124284731-2c49c780-db88-11eb-9f29-f22cecef59a7.png)
객체 URL
복사
![스크린샷 2021-07-02 오후 10 35 39](https://user-images.githubusercontent.com/86812249/124284732-2ce25e00-db88-11eb-810c-2c13f85bee23.png)
당연히 안 된다.
![스크린샷 2021-07-02 오후 10 35 48](https://user-images.githubusercontent.com/86812249/124284733-2d7af480-db88-11eb-871c-d5392c776b38.png)
심화/옵션)S3 Browser 통해서 S3 버킷 보기
- 맥북이라 못 한다..ㅠ 아쉽다
![스크린샷 2021-07-03 오전 12 04 34](https://user-images.githubusercontent.com/86812249/124294162-5a340980-db92-11eb-9f61-1ad534692da8.png)
자원 삭제(중요!)
EC2 인스턴스 종료
EBS 스냅샷 삭제
EBS 볼륨 삭제
EFS 삭제
S3 삭제
CloudFormation 삭제**
참고 자료 : AFOS[2기] 노션 내용
[AWS] 4주차-3 AWS S3 실습
http://example.com/2021/07/01/2021-06-30-AFOS-3/