Error creating CodeBuild project - CodeBuild is not authorized to perform...

0

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.

1개 답변
0
수락된 답변

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"
                ]
            }
        }
    ]
}
답변함 2년 전
profile picture
전문가
검토됨 7달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠