본문 바로가기

INFRA

AWS CLI 설치

AWS Cloud 기본 명령어

AWS CLI 설치

* python 설치
- sudo yum install python27
* pip 설치
- curl -O https://bootstrap.pypa.io/get-pip.py
- sudo python get-pip.py
* pip install awscli --upgrade --user


* 버전 확인
- aws --version


* 삭제
- pip uninstall awscli

* aws cli 설정
- aws configure
AWS Access Key ID [None]: AKIAIOSFODNN7EXAMPLE
AWS Secret Access Key [None]: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Default region name [None]: ENTER
Default output format [None]: ENTER

mac 에서 CLI 설치

$ brew install awscli

S3 command 명령어

aws s3 help

Single Local File and S3 Object Operations
Some commands perform operations only on single files and S3 objects.
The following commands are single file/object operations if no --recur-
sive flag is provided.

o cp

o mv

o rm

For this type of operation, the first path argument, the source, must
exist and be a local file or S3 object. The second path argument, the
destination, can be the name of a local file, local directory, S3
object, S3 prefix, or S3 bucket.

The destination is indicated as a local directory, S3 prefix, or S3
bucket if it ends with a forward slash or back slash. The use of slash
depends on the path argument type. If the path argument is a Local-
Path, the type of slash is the separator used by the operating system.
If the path is a S3Uri, the forward slash must always be used. If a
slash is at the end of the destination, the destination file or object
will adopt the name of the source file or object. Otherwise, if there
is no slash at the end, the file or object will be saved under the name
provided. See examples in cp and mv to illustrate this description.

Directory and S3 Prefix Operations
Some commands only perform operations on the contents of a local direc-
tory or S3 prefix/bucket. Adding or omitting a forward slash or back
slash to the end of any path argument, depending on its type, does not
affect the results of the operation. The following commands will
always result in a directory or S3 prefix/bucket operation:

o sync

o mb

o rb

o ls


* s3 리스트 내역 확인
- sudo aws s3 ls pointwell-devops/Daiso_Order/
* s3 리스트 복사 하기
- sudo aws s3 cp s3://pointwell-devops/Daiso_Order/20160717_d.txt /home/centos/daiso_order/

* s3 검색
- aws s3 ls s3://pointwell-devops/logs_backup/app --recursive | grep 2017-02-26

pem 파일 권한

  • chmod 400 펜파일 명


'INFRA' 카테고리의 다른 글

[GCP] Mysql DB 만들기  (0) 2019.03.04