์ƒ์„ธ ์ปจํ…์ธ 

๋ณธ๋ฌธ ์ œ๋ชฉ

[TIL] AWS cli๋ฅผ ์‚ฌ์šฉํ•ด์„œ s3 ํŒŒ์ผ ์ผ๊ด„ ๋‹ค์šด๋ฐ›๊ธฐ 220921

CLOUD/AWS

by ์—์Šคํ”„๋ฆฌํ„ฐ 2022. 9. 21. 08:46

๋ณธ๋ฌธ

728x90
๐Ÿ’ก Today I Learned ์š”์•ฝ (9ํšŒ์ฐจ)
- AWS CLI๋ฅผ ์‚ฌ์šฉํ•ด์„œ s3 ๋ฐ์ดํ„ฐ๋ฅผ ์ผ๊ด„ ๋‹ค์šด ๋ฐ›์„ ์ˆ˜ ์žˆ๋‹ค
- ๋ช…๋ น์–ด๋Š” aws cp๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ๋จ

 

AWS cli๋ฅผ ์‚ฌ์šฉํ•ด์„œ s3 ํŒŒ์ผ ์ผ๊ด„ ๋‹ค์šด๋ฐ›๊ธฐ

AWS s3์— ์žˆ๋Š” ๋ฐ์ดํ„ฐ๋ฅผ ๋‹ค์šด ๋ฐ›๊ณ  ์‹ถ์„ ๋•Œ ์›น ํ™”๋ฉด์—์„œ๋Š” ํด๋” ๋‹จ์œ„๋กœ ์ผ๊ด„ ๋‹ค์šด๋กœ๋“œ๋ฅผ ์ง€์›ํ•˜์ง€ ์•Š๋Š”๋‹ค. ๊ทธ๋ž˜์„œ ๊ฐœ๋ณ„๋กœ ํ•˜๋‚˜ํ•˜๋‚˜ ๋“ค์–ด๊ฐ€์„œ ๋‹ค์šด์„ ๋ฐ›์•„์•ผ ํ•˜๋Š”๋ฐ ์ด๋Ÿด ๊ฒฝ์šฐ์—” AWS CLI๋ฅผ ์“ฐ๋Š” ๊ฒŒ ํŽธ๋ฆฌํ•จ.

 

1. AWS ํ™ˆํŽ˜์ด์ง€์—์„œ CLI๋ฅผ ๋‹ค์šด๋ฐ›๊ณ  ์„ค์น˜

2. ํ„ฐ๋ฏธ๋„(๋ช…๋ น ํ”„๋กฌํ”„ํŠธ)๋ฅผ ์—ด๊ณ  aws configure๋ฅผ ์ž…๋ ฅํ•˜์—ฌ ์„ค์ •๊ฐ’ ์ž…๋ ฅ

aws configure
AWS Access Key ID [None]:
AWS Secret Access Key [None]: 
Default region name [None]: 
Default output format [None]:

3. aws s3 cp {s3 ๊ฒฝ๋กœ} {๋‹ค์šด๋ฐ›์„ ๋กœ์ปฌ ๊ฒฝ๋กœ} --recursive ๋ฅผ ํ†ตํ•ด์„œ ํŒŒ์ผ ๋‹ค์šด๋กœ๋“œ, ๋‹จ์ผ ํŒŒ์ผ ๋‹ค์šด๋กœ๋“œ ์‹œ์—๋Š” recursive๊ฐ€ ํ•„์š”์—†์ง€๋งŒ, ํด๋” ์ „์ฒด๋ฅผ ๋‹ค์šด๋ฐ›์œผ๋ ค๋ฉด recursive ์„ค์ •์ด ํ•„์š”ํ•จ.

aws s3 cp my-local-folder s3://my-s3-bucket/ --recursive

 

 


#AWS ๊ด€๋ จ ์ž‘์„ฑ ๋ฐ ๋ฆฌ์„œ์น˜ ๋‚ด์—ญ:

ํƒœ๊ทธ

๊ด€๋ จ๊ธ€ ๋”๋ณด๊ธฐ

๋Œ“๊ธ€ ์˜์—ญ