Upload S3 on CLI

Let's Just Go·2023년 5월 28일
0

AWS

목록 보기
3/3

From EC2 Instance To S3 Bucket

  • S3 Config
    • Bucket 생성
      • Backup File이 들어갈 Object 생성
    • Role 설정
      • 사용하는 IAM에서 AmazonS3FullAccess 권한을 부여

  • AWS CLI 설치

  • S3 연동

    aws configure 
    
    AWS Access Key ID [None]: [Access Key]
    AWS Secret Access Key [None]: [Secret Key]
    Default region name [None]: ap-northeast-2
    Default output format [None]: [공백 enter]

  • Upload & Download
    aws s3 ls
    # 내 계정에 존재하는 S3 버킷 리스트 출력 
    
    aws s3 cp [source파일명] s3://[destination버킷명]/[destination파일명]
    # s3에 instance에 있는 특정 파일 업로드 
    
    aws s3 cp [디렉토리 경로] s3://[destination버킷명]/[destination파일명] --recursive
    # s3에 instance에 있는 디렉토리 경로 아래에 있는 모든 파일 업로드 
    
    aws s3 cp s3://[source버킷명]/[source파일명] [destination파일명]
    # instance에 s3에 있는 특정 파일 다운로드 
    
    aws s3 cp s3://[source버킷명]/[source파일명] [destination파일명] --recursive
    # instace에 s3에 있는 디렉토리 경로에 아래에 모든 파일 다운로드 
    

  • 참고

https://bosungtea9416.tistory.com/m/entry/s3-여러-파일-올리기

https://twofootdog.tistory.com/36

profile
안녕하세요! 공부한 내용을 기록하는 공간입니다.

0개의 댓글