Skip to content

CodePipeline Service Role – Insufficient Permissions for CodeStar/CodeConnections

0

I'm trying to configure an AWS CodePipeline with a GitHub (OAuth) source action. However, the pipeline fails at the source stage with the following error: Unable to use Connection: arn:aws:codeconnections:. The provided role does not have sufficient permissions.

I reviewed AWS documentation and added the recommended policy to the CodePipeline service role: { "Version": "2012-10-17", "Statement": { "Effect": "Allow", "Action": [ "codeconnections:UseConnection" ], "Resource": "*" } }

Even after adding this both codeconnections & codestar-connections all permissions, the error still occurs. I need some guidance on an issue I'm facing with AWS CodePipeline to understand why the source action cannot use the connection and what additional permissions or configuration might be required?

3 Answers
0

Hello.

I think the answer at the following URL is relevant:
CodeConnections was previously known as CodeStar until a few years ago.
Using "codestar-connections" may solve the problem.
https://repost.aws/questions/QUWOxbjBL-S4SkUoK0ameT-g/codepipeline-service-role-insufficient-permission-for-codestar-connections

EXPERT

answered a year ago

0

Hey,

Hope you're keeping well.

For a GitHub source stage using CodeConnections, the CodePipeline service role must have codestar-connections:UseConnection on the specific connection ARN, not just *. Go to IAM, edit the pipeline’s role, and add a statement granting codestar-connections:UseConnection for the exact ARN you see in the CodeConnections console. Also verify that the connection status is Available and that the role trust policy allows codepipeline.amazonaws.com to assume it. If you updated the role after creating the pipeline, redeploy or manually retry the execution so the new permissions are applied.

Thanks and regards,
Taz

answered a year ago

0

Hey,

Hope you're keeping well.

For GitHub source actions in CodePipeline using CodeConnections, the service role needs both codeconnections:UseConnection and codestar-connections:UseConnection on the specific connection ARN, not just "*" as the resource. Make sure the policy is attached to the pipeline’s execution role (visible under CodePipeline > Your Pipeline > Settings > Service role), and that the connection status in Developer Tools > Connections is Available. If the connection is in Pending or Needs Update, reauthorize it from the console before running the pipeline. Also confirm that the service role trust policy allows codepipeline.amazonaws.com to assume it.

Thanks and regards,
Taz

answered a year 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.