본문 바로가기

퍼블릭 클라우드

AWS Command Line Interface(AWS CLI)를 최신 버전으로 설치하는 방법

반응형

AWS Command Line Interface(AWS CLI)를 최신 버전으로 설치하는 방법

AWS Command Line Interface(AWS CLI) 설치

curl -s "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install

AWS CLI 경로 확인

which aws
> which aws
/usr/local/bin/aws

AWS CLI 버전 정보 확인

aws --version
$ aws --version
aws-cli/2.9.12 Python/3.9.11 Linux/5.10.157-139.675.amzn2.x86_64 exe/x86_64.amzn.2 prompt/off
728x90

액세스 키(AWS Access Key)와 비밀 액세스 키(AWS Secret Access Key)를 등록합니다.

aws configure
  • "AWS Access Key ID"와 "AWS Secret Access Key"에 본인의 액세스 키와 비밀 액세스 키를 입력합니다.
  • "Default region name"에는 사용하려는 AWS 리전을 입력합니다. 예를 들어, "us-west-2"나 "ap-southeast-1"과 같이 리전 식별자를 입력합니다.
  • "Default output format"은 원하는 출력 형식을 선택합니다. 보통 "json"으로 설정합니다.
> aws configure
AWS Access Key ID [None]: AKIAT
AWS Secret Access Key [None]: lk0ja
Default region name [None]: ap-northeast-2
Default output format [None]: json

액세스 키(AWS Access Key)와 비밀 액세스 키(AWS Secret Access Key)의 목록를 확인합니다.

aws configure list
> aws configure list
      Name                    Value             Type    Location
      ----                    -----             ----    --------
   profile                <not set>             None    None
access_key     ****************XD5I shared-credentials-file
secret_key     ****************RjjR shared-credentials-file
    region           ap-northeast-2      config-file    ~/.aws/config

AWS 액세스 키의 값(정보)을 출력

aws configure get aws_access_key_id

AWS 비밀 액세스 키의 값(정보)을 출력

aws configure get aws_secret_access_key

AWS 계정의 호출자 식별 정보를 출력

aws sts get-caller-identity

 

aws-cli.pdf
0.41MB

 

참고URL

- AWS CLI로 액세스 키(Access Key, Secret Access Key) 설정 : https://scbyun.com/1121

- 최신 버전의 AWS CLI 설치 또는 업데이트: https://docs.aws.amazon.com/ko_kr/cli/latest/userguide/getting-started-install.html

- aws cli list : https://docs.aws.amazon.com/cli/latest/reference/configure/list.html

- aws cli get : https://docs.aws.amazon.com/cli/latest/reference/configure/get.html

 

반응형