AWS-CLI 계정 등록 및 전환 방법
개요
계정 등록
$ aws configure --profile ユーザー名
위 명령 실행$ aws configure --profile ユーザー名(test)
AWS Access Key ID [None]: アクセスキー入力
AWS Secret Access Key [None]: シークレットアクセスキー入力
Default region name [None]: リージョン入力
Default output format [None]: json
집행 후 상술한 것이 하나하나 나타나 등록을 진행한다.등록이 완료되었는지 확인합니다.
$ tree ~/.aws
/Users/user/.aws
├── config
└── credentials
계층 구조 확인 후 이동cd /Users/user/.aws/
credential의 내용 확인$ cat credentials
[default(会社アカウント)]
aws_access_key_id = XXXXXXXXXXXXXXXX
aws_secret_access_key = XXXXXXXXXXXXXXXX
[test]
aws_access_key_id = SSSSSSSSSSSSSSSSSSSSSS
aws_secret_access_key = SSSSSSSSSSSSSSSSSSSSS
등록을 확인합니다.계정 전환
현재 계정 확인
$ aws configure list
Name Value Type Location
---- ----- ---- --------
profile 会社アカウント manual --profile
access_key ****************PX7B shared-credentials-file
secret_key ****************9N8q shared-credentials-file
region ap-southeast-1 config-file ~/.aws/config
상기 명령을 실행할 때 현재 사용하는 계정 정보를 출력합니다.프로필을 봤는데 회사 계좌라서 이번에 만든 테스트라는 계좌로 전환해야 해요.
$ export AWS_DEFAULT_PROFILE=ユーザー名
상기 명령으로 변경할 수 있기 때문에 이번에 제작한test를 지정하여 집행한다.$ export AWS_DEFAULT_PROFILE=test
확인$ aws configure list 日 12/20 02:57:33 2020
Name Value Type Location
---- ----- ---- --------
profile test manual --profile
access_key ****************IEPM shared-credentials-file
secret_key ****************VPOT shared-credentials-file
region ap-northeast-1 config-file ~/.aws/config
변경 완료.
Reference
이 문제에 관하여(AWS-CLI 계정 등록 및 전환 방법), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://zenn.dev/koniman/articles/c2cb227192f02a텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)