AWS S3를 aws-cli로 관리하자

in #kr-dev5 years ago (edited)

AWS S3

AWS s3는 아마존에서 제공하는 스토리지 서비스입니다다.

쉽게 말하면, 구글 드라이브나 드랍박스 같은 느낌입니다.

데이터 확장에 용이하다고 해서 사용해보게 됐습니다. (돈만 내면 된다.)

지금은 Free tier라서 무료로 사용중입니다.

AWS S3가 필요했던 이유

저는 AWS-s3를 이미지 호스팅, 데이터 저장을 위해 사용하고 있습니다.

데이터 양이 적어 console page에서 파일을 관리했었습니다.

근데 파일이 점점 많아지고, 수정하거나 새로 업데이트한 파일 목록을 열람할 필요가 있어서 콘솔만으로는 안되겠다 생각했습니다.

aws-s3 explorer로 찾아보다 ftp, aws-cli등이 있었습니다. 저는 aws-cli를 선택했습니다.

AWS S3 관리 시스템 필요

aws-cli를 활용해서 관리하기로 했습니다.

https://console.aws.amazon.com/iam/home?region=ap-northeast-2#/security_credentials

  • create new access key

sudo apt-get -y install awscli

aws configure

  • 발급받은 access key, private key를 입력합니다. bucket의 지역도 입력합니다.

aws s3 sync s3://buckey_name/folder ~/workspace/aws-s3-storage

aws s3 sync ~/workspace/aws-s3-storage/ s3://bucket_name/folder –acl public-read

  • s3 to local folder, local folder to s3가 가능하다. sync는 업데이트된 파일만 업로드한다.
  • –acl public-read는 누구나 파일을 읽을 권한을 주는 것을 말한다.

aws-cli 짱!

감사합니다.


참고

https://github.com/blackmaz/saltstack_test/wiki/AWS-S3-%ED%8C%8C%EC%9D%BC%EC%84%9C%EB%B2%84%EB%A1%9C-%EC%82%AC%EC%9A%A9%ED%95%98%EA%B8%B0

https://ngee.tistory.com/1137

Sort:  

짱짱맨 호출에 응답하였습니다.

Congratulations @jacobyu! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

You got more than 400 replies. Your next target is to reach 500 replies.

You can view your badges on your Steem Board and compare to others on the Steem Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

Do not miss the last post from @steemitboard:

Are you a DrugWars early adopter? Benvenuto in famiglia!
Vote for @Steemitboard as a witness to get one more award and increased upvotes!

Hi @jacobyu!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your UA account score is currently 2.776 which ranks you at #13302 across all Steem accounts.
Your rank has improved 185 places in the last three days (old rank 13487).

In our last Algorithmic Curation Round, consisting of 225 contributions, your post is ranked at #191.

Evaluation of your UA score:
  • Only a few people are following you, try to convince more people with good work.
  • You have already convinced some users to vote for your post, keep trying!
  • Try to improve on your user engagement! The more interesting interaction in the comments of your post, the better!

Feel free to join our @steem-ua Discord server

Coin Marketplace

STEEM 0.27
TRX 0.11
JST 0.030
BTC 68897.34
ETH 3759.92
USDT 1.00
SBD 3.44