AWS cli - 터미널에서 AWS 다루기

Human Being·2022년 3월 23일
0

AWS

목록 보기
2/6
post-thumbnail

AWS cli는 터미널에서 AWS를 명령어를 통해 이용할 수 있도록 한 것
더불어 사용자 정보를 로컬 컴퓨터에 저장해둠으로써
인증된 사용자임을 증명해준다

설치

앞 포스트에서 이미 Admin 권한을 넣은 User의
Access key와 Secret key를 아는 상태에서 진행하자

https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html

aws cli 환경변수 추가하기

아마 안 해도 될 테지만
이와 관련한 에러가 발생할 때를 대비하여 적었다
먼저 건너뛰고 진행해보길
https://docs.aws.amazon.com/cli/latest/userguide/getting-started-path.html

aws configure

$ aws configure
AWS Access Key ID [None]: AKIAIOSFODNN7EXAMPLE
AWS Secret Access Key [None]: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Default region name [None]: us-west-2
Default output format [None]: json

profile

여러 계정하거나, region마다 다른 서비스를 이용하고 있다면
configure를 다시 설정해야하는 번거로움이 있을 수 있지만
이를 방지하기 위해
aws configure --profile {configure 파일 이름}
으로 적고 profile을 설정할 수 있을 때
해당 파일을 선택하면 된다

profile 목록을 확인하고 싶다면

aws configure list

aws configure set : 특정 항목만 교체

key는 그대로이지만 region만 바꿔서 사용하고 싶다면

aws configure set region {new region name} --profile {configure file name}

+) 특정 항목만 확인하고 싶다면

aws configure get region --profile {configure file name}

0개의 댓글