Open brodster2 opened 1 month ago
Voting for Prioritization
Volunteering to Work on This Issue
Could you double check that the permissions configured within the project have sufficient permissions to create an organization webhook i.e. organization admin permissions? In this case, it's possible that the exception message is incorrect and it is really a permissions issue. Additionally, you may want to verify that your authentication method isn't being used somewhere else that is consuming your GitHub limit e.g. you use a PAT that is also being used elsewhere. If you continue to run into issues, please email CodeBuild at codebuild-feedback@amazon.com
with the issue details/request ID/request time so that we can look into it deeper
I had the same issue. Your user must be the owner of an organization to create a webhook under that organization.
Could you double check that the permissions configured within the project have sufficient permissions to create an organization webhook i.e. organization admin permissions? In this case, it's possible that the exception message is incorrect and it is really a permissions issue. Additionally, you may want to verify that your authentication method isn't being used somewhere else that is consuming your GitHub limit e.g. you use a PAT that is also being used elsewhere. If you continue to run into issues, please email CodeBuild at
codebuild-feedback@amazon.com
with the issue details/request ID/request time so that we can look into it deeper
Hi @colyoonamaz,
Sorry for the late reply. I'm using the AWS Connector for GitHub app to do the WebHook creation after setting up the connection to my GitHub organisation:
CodeBuild would be using the same default code connection for both methods (aws_codebuild_webhook
or aws codebuild create-webhook
) wouldn't it?
Hey @brodster2 👋 Thank you for taking the time to raise this!
CodeBuild would be using the same default code connection for both methods (
aws_codebuild_webhook
oraws codebuild create-webhook
) wouldn't it?
The aws_codebuild_webhook
resource will be created using the credentials provided to the Terraform AWS Provider. When using the local-exec
provisioner within the terraform_data
resource, however, the credentials might be the same (depending on how you're providing credentials to the provider), but aren't necessarily guaranteed to be. It could be that local-exec
is picking up different credentials with different permissions based on environment variables, etc.
Terraform Core Version
v1.7.5
AWS Provider Version
v5.66.0
Affected Resource(s)
Expected Behavior
The webhook creates successfully
Actual Behavior
Get the error:
Error: creating CodeBuild Webhook (github-test): operation error CodeBuild: CreateWebhook, https response error StatusCode: 400, RequestID: bb4afbfb-90fd-4b6a-8275-d3fb43ac850d, OAuthProviderException: Failed to create webhook. GitHub API limit reached. Please try again later.
And this is after re-running several times, and waiting up to 30 minutes between tries.
Relevant Error/Panic Output Snippet
No response
Terraform Configuration Files
Steps to Reproduce
Before applying any Terraform I setup the new GitHub app Oauth authentication method by following https://docs.aws.amazon.com/codebuild/latest/userguide/access-tokens-github-overview.html#connections-github-app and then running the command
aws codebuild import-source-credentials --auth-type CODECONNECTIONS --server-type GITHUB --token <connection-arn>
to make that connection the default authentication method used by codebuild.Then once running terraform apply I hit the error. But if I comment out the webhook resource and use the
terraform_data
instead to run the cli command with the same configuration, the webhook creates no problem.Debug Output
No response
Panic Output
No response
Important Factoids
No response
References
Would you like to implement a fix?
None