Error creating CodeBuild project - CodeBuild is not authorized to perform...
Hello Everyone, I am trying to build a codebuild CI/CD project on AWS with CodePipeline and Terraform. In fact I am trying to replicate this repo [https://github.com/davoclock/aws-cicd-pipeline] following along with the instructions in this video https://www.youtube.com/watch?v=JwTP3wZHYnU.
When I try to run terraform apply after setting up my pipeline, I get the following error "Error creating CodeBuild project: InvalidInputException: CodeBuild is not authorized to perform: sts:AssumeRole on arn:aws:iam::xxxxxxxxxxxx:role/tf-codebuild-role"
I will greatly appreciate any help with resolving this.
Can you check if your IAM role tf-codebuild-role
has the correct trust policy (https://docs.aws.amazon.com/IAM/latest/UserGuide/roles-managingrole-editing-console.html#roles-managingrole_edit-trust-policy)?
It should grant codebuild permission to assume it, i.e.
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "sts:AssumeRole" ], "Principal": { "Service": [ "codebuild.amazonaws.com" ] } } ] }
Relevant questions
CodeBuild is not authorized to perform: sts:AssumeRole
asked 3 years agoUse same CodeBuild project for multiple GitHub repositories
Accepted Answerasked a year agoCodeBuild vs CodePipeline with Bitbucket Cloud Repo
asked 6 months agostopping a codepipeline build does not stop the codebuild batch
Accepted Answerasked 23 days agoAWS Codebuild Batch Event Notifications
Accepted Answerasked 6 months agoCan't install Ruby on CodeBuild
asked 5 months agoError creating CodeBuild project - CodeBuild is not authorized to perform...
Accepted Answerasked 23 days agoPermission error when trying codebuild local, works in the cloud
asked 3 years ago[CodeBuild] Error to build with the CodeBuild
asked 22 days agoCodePipeline - how to pass and consume multiple artifacts across CodeBuild Steps?
asked 5 months ago