CDK Codepipeline with github : insufficient permissions

0

I've been using aws cdk with github to set up my cicd pipeline for a while. This is the main tutorial I followed https://docs.aws.amazon.com/cdk/v2/guide/cdk_pipeline.html#cdk_pipeline_define. Along with this video https://www.youtube.com/watch?v=EVDw0sdxaec&t=433s which shows how to set up a github personal access token and save it to secrets manager.

Whenever the github personal access token would expire, I would just create a new one and update the secret in aws secrets manager.

However today. Even after reseting the access token the codepipeline does not work. It fails at soucing the github repo and give the following error and explanation.

Insufficient permissions


Could not access the GitHub repository: "REDACTED". The access token might be invalid or has been revoked. Edit the pipeline to reconnect with GitHub.
已提問 2 年前檢視次數 242 次
1 個回答
1

I have experienced this issue in a similar manner when using GitHub V1 source action, which AWS does not recommend. When I would manually expire a GitHub oauth token and update the token in AWS Secrets Manager, it would continue to use the original token. AWS secrets are often cached client side to reduce the number of hits to AWS Secrets Manager. This is done to optimize performance. However, in this case, there is a need to expire the client side cache. The workaround that I used was to establish a new secret name and switch AWS CodePipeline to use this new secret.

The preferred solution is to switch to GitHub version 2 source action. AWS has provided instructions to Update a GitHub version 1 source action to a GitHub version 2 source action

profile picture
已回答 10 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南