티스토리 뷰

개발/aws

[AWS] s3 bucket 동기화

senni 2020. 6. 15. 11:53

1. AWS CLI 설치

https://docs.aws.amazon.com/ko_kr/cli/latest/userguide/cli-chap-install.html

 

AWS CLI 설치 - AWS Command Line Interface

이 페이지에 작업이 필요하다는 점을 알려 주셔서 감사합니다. 실망시켜 드려 죄송합니다. 잠깐 시간을 내어 설명서를 향상시킬 수 있는 방법에 대해 말씀해 주십시오.

docs.aws.amazon.com

2. AWS CLI 구성(windows의 경우 cmd에서 작업)

- 사용할 IAM에 사용할 버킷들에 대한 권한이 지정되어 있어야함

$ aws configure --profile produser # AWS IAM 사용자 추가

AWS Access Key ID [None]: AKIAI44QH8DHBEXAMPLE
AWS Secret Access Key [None]: je7MtGbClwBF/2Zp9Utk/h3yCo8nvbEXAMPLEKEY
Default region name[None]: ap-northeast-2
Default output format [None]: ENTER

 

https://docs.aws.amazon.com/ko_kr/cli/latest/userguide/cli-chap-configure.html

 

AWS CLI 구성 - AWS Command Line Interface

AWS에서는 모든 수신 요청이 암호화 서명되어야 합니다. AWS CLI에서 이 작업을 수행합니다. "서명"에는 날짜/시간 스탬프가 포함됩니다. 따라서 컴퓨터의 날짜 및 시간이 올바르게 설정되어야 합��

docs.aws.amazon.com

3. s3 bucket sync

$ aws s3 ls # s3 목록 조회
$ aws s3 ls s3://bucket1 # 지정한 버킷 내 파일 목록 조회

$ aws s3 sync . s3://bucket1 # 로컬디렉토리를 bucket1에 동기화
$ aws aws s3 sync s3://bucket1 s3://bucket2 # bucket1을 bucket2에 동기화
$ aws aws s3 sync s3://bucket1/folder s3://bucket2/folder # 폴더 단위로 bucket1을 bucket2에 동기화

https://docs.aws.amazon.com/cli/latest/reference/s3/sync.html

 

sync — AWS CLI 1.18.79 Command Reference

Note: You are viewing the documentation for an older major version of the AWS CLI (version 1). AWS CLI version 2, the latest major version of AWS CLI, is now stable and recommended for general use. To view this page for the AWS CLI version 2, click here. F

docs.aws.amazon.com

https://aws.amazon.com/ko/premiumsupport/knowledge-center/move-objects-s3-bucket/

 

Amazon S3 버킷 간 객체 복사

Amazon Simple Storage Service(S3) 버킷 간에 객체를 모두 이동해야 합니다. S3 버킷 간에 객체를 마이그레이션하려면 어떻게 해야 합니까? 

aws.amazon.com

https://aws.amazon.com/ko/premiumsupport/knowledge-center/copy-s3-objects-account/

 

다른 AWS 계정의 S3 객체 복사

다른 AWS 계정의 버킷에서 Amazon Simple Storage Service(Amazon S3) 객체를 복사하려고 합니다. 그런 다음 내 계정(대상 계정)이 복사된 객체를 소유하는지 확인하려고 합니다. 어떻게 해야 합니까?

aws.amazon.com

댓글