Create profile
aws configure --profile profile-name
cd ~/.aws/config
- Profile is configured as below
[profile profile-name]
region = ap-southeast-2
output = json
aws configure list --profile profile-name
Add private key
- If you do not have one, create a file ~/.aws/credentials
[a-profile-name]
aws_access_key_id=AAAAAAAAAAAAAAAAAAAA
aws_secret_access_key=zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
region=us-east-1
- Get a token and put it into Mac environment variables
export MY_AUTH_TOKEN=`aws codeartifact get-authorization-token --domain {{a-domain-name}} --domain-owner {{123456789012}} --query authorizationToken --output text --profile {{a-profile-name}}`
echo $MY_AUTH_TOKEN
- You can now log in by username and password (above token)
Leave a Reply