When I try to use the AWS CLI to run commands for the new AWS CodeCatalyst service, the command hangs for a bit and I keep getting the same error: Unable to locate authorization token
I verified that my AWS profile/credentials are pointing to the AWS account that I linked when I signed up for CodeCatalyst.
% aws --profile dev-admin s3 ls
2020-06-03 06:44:13 bucket1
2022-10-31 16:45:08 bucket2
% aws --profile dev-admin codecatalyst list-access-tokens
Unable to locate authorization token
What am I doing wrong?
You can't use your normal AWS credentials when running AWS CLI commands for
codecatalystbecause CodeCatalyst uses our AWS Builder ID as your user to authenticate and you need a special profile for that.To get this working, add the following to your
~/.aws/configfile to create a profile (calling itcodecatalystin this example):Then you can run the
logincommand to login and get your credentials setup in the CLI. It will redirect you to a browser window where you need to login with your AWS Builder ID that you used to sign up with CodeCatalyst.After this, you can successfully run CodeCatalyst CLI commands using your new profile:
Reference: