본문 바로가기
[AWS-SM]/IAM

[AWS CLI] AWS Configure 여러 계정 사용하기

by SAMSUNG Metaverse-Cloud 2023. 1. 28.
728x90

 

 

aws configure --profile

  • AWS CLI 는 --profile 옵션을 통해,
  • 여러 AWS 계정에 접근하도록 관리할 수 있습니다.

AWS CLI 설정

  • AWS CLI 를 설정하는 것은 어렵지 않습니다.
  • 우선, aws configure 로 접근할 AWS 계정의 Console 화면에 접근한 뒤,
  • IAM 사용자를 생성하고 Access Key를 발급하면 됩니다.
  • Access Key 를 발급했다면, 아래 명령어를 통해 aws configure 설정을 진행하며, --profile 옵션에 계정 이름을 할당합니다.
      AWS Access Key ID [None]:
      AWS Secret Access Key [None]: 
      Default region name [None]: 
      Default output format [None]: 
  • aws configure --profile username

인증 설정 확인

  • 인증 내용은 ~/.aws/config 와 ~/.aws/credentials 에 나눠서 저장됩니다.
  • credentials 에는 인증과 관련된 값들이 저장되고,
  • 그 외의 설정은 config 파일에 저장됩니다.
      cat ~/.aws/credentials
  • cat ~/.aws/config

테스트

  • 간단한 aws cli 명령어를 통해,
  • aws cli 설정이 정상적으로 적용됐는지 확인합니다.
  • aws s3 ls --profile "username"

 

 

참고

 

list — AWS CLI 1.27.58 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

 

 

728x90

댓글