By using AWS re:Post, you agree to the Terms of Use

CodeBuild is not authorized to perform: sts:AssumeRole


I am trying to switch from creating CodeBuild jobs manually to creating them using the CLI.
However I am running into issues doing this.
Command I am running:

aws codebuild create-project --name "PROJECTNAME" --region "us-east-1" --source type=GITHUB,location="GITHUBURL",gitCloneDepth=1 --artifacts type=NO_ARTIFACTS --environment type=LINUX_CONTAINER,image=aws/codebuild/docker:18.09.0,computeType=BUILD_GENERAL1_SMALL --service-role SERVICE_ROLE

For this the SERVICE_ROLE is a role that I am currently using in another CodeBuild job. But when I try to run it from the CLI I am getting:

An error occurred (InvalidInputException) when calling the CreateProject operation: CodeBuild is not authorized to perform: sts:AssumeRole on [ARNTO_SERVICE_ROLE]

I tried adding the permission for sts:AssumeRole to that service role, but that did not fix the issue.
The CLI is using an admin role and should any rights necessary for it to be able to do this.

asked 4 years ago649 views
1 Answer

Hi jonwis, I am Yong from AWS CodeBuild team.

Do you still see this error? My suggestion is to follow this troubleshooting guide.

If you still see the same error, can you please run the command with debug logging turned on and private message me the entire response payload? I can then help troubleshoot on our side.

aws codebuild --debug create-project ...
answered 4 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions