1

I'm trying to create my webscraper project and I'm following this guide: "https://github.com/thejoeosborne/scheduled-scraper-example". I uploaded all the account ids and regions in my fork version of the repo and when I try to start build in Codebuild, I get the following error

Failed to get access token from arn:aws:codeconnections:eu-north-1:<account-id>:connection/6ea9d036-ab6b-4ca7-9524-7b7d221068b0: Access denied to connection arn:aws:codeconnections:eu-north-1:<account-id>:connection/6ea9d036-ab6b-4ca7-9524-7b7d221068b0

I cannot find any resource to troubleshoot this error. I'm guessing that I'm missing some permissions.

3
  • Did you change the message to show <account-id> or is it the actual value that it shows? Commented Feb 20 at 12:29
  • I changed it to <account-id> for this post, the actual error shows the actual number. @Caldazar Commented Feb 21 at 18:51
  • CodeBuild uses a service role. What permissions that role has? It's most likely that the role is missing a permission Commented Feb 21 at 20:43

1 Answer 1

4

I was running into the same problem. Defining the following permissions on the service role linked to the CodeBuild project got me past the error:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "Statement1",
            "Effect": "Allow",
            "Action": [
                "codeconnections:UseConnection",
                "codeconnections:GetConnectionToken"
            ],
            "Resource": [
                "arn:aws:codeconnections:<region>:<account-id>:connection/<connection-id>"
            ]
        }
    ]
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.