[aws-amplify] Can't connect to GitHub
See original GitHub issue❓ General Issue
The Question
I’m trying to add an Amplify app via CDK but can’t connect to GitHub with my Personal Access Token (repo scope).
const amplifyApp = new amplify.App(this, 'App', {
sourceCodeProvider: new amplify.GitHubSourceCodeProvider({
owner: 'x',
repository: 'y',
oauthToken: cdk.SecretValue.plainText(process.env.PAT as string)
}),
});
2:27:59 PM | CREATE_FAILED | AWS::Amplify::App | LandingF95672E9
There was an issue setting up your repository. Please try again later.({"message":"Not Found","documentation_url":"https://docs.github.com/rest/reference/repos#create-a-repository-webhook"
}) (Service: Amplify; Status Code: 400; Error Code: BadRequestException; Request ID: -)
I assume this is an access issue? However the access seems right to me. Am I using the plain text secret correctly? I also tried non-plain text but ran into different issues. For now, I’d just like to get it working as simple as possible.
Environment
- CDK CLI Version: 6.14.6
- Module Version:
- Node.js Version: v14.6.0
- OS: WSL2
- Language (Version): TS
Other information
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Unable to connect repository to existing amplify app #1554
Create a new GitHub Repository; Clone it via GitHub Explorer; Start Visual Studio Code and open newly cloned Folder; Install Amplify CLI ...
Read more >Unable to connect to Github · Issue #2733 · aws-amplify ...
In deploying a new Nextjs application, I am unable to get Amplify to connect to Github. The amplify deployment is done with CDK...
Read more >Can't connect Github Repo · Issue #564
I have a react website up and running by using the Amplify CLI and I am able to deploy successfully by doing an...
Read more >I can't "Connect branch" · Issue #2731 · aws-amplify ... - GitHub
I go to "Connect branch" and it says "GitHub authorization was successful." but when I click Next I got "Please select a repository...
Read more >Amplify can't connect to gitlab ( previously it worked ) #2635
We are trying to connect amplify to gitlab, this started to occurs in the last two days. We can't anymore connect on gitlab...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I had this problem, and the underlying problem was that the user that created the Personal Access Token must also (for some reason) be an Admin of the repository: https://github.com/aws-amplify/amplify-console/issues/2160
My issues was storing the GitHub PAT as a key/value pair in AWS Secrets manager, which then requires that you pass the json option to the
SecretManager
. I rather saved it as a Plaintext secret, and that did the job.This is what helped me: https://github.com/aws/aws-cdk/issues/3515#issuecomment-517844714