I’m trying to set up an AWS CodePipline using the Cloudposse ecs-codepipeline
module. The plan step works when I run it on Terraform Cloud, but with this warning:
Warning: The CodePipeline GitHub version 1 action provider is deprecated.
But it allows me to apply, and when I do it fails in the github_repository_webhooks
module. I get the following error:
Error: POST https://api.github.com/repos/MyOrg/my-repo/hooks: 404 Not Found
with module.project_module.module.ecs_codepipeline.module.github_webhooks.github_repository_webhook.default[0]
on .terraform/modules/project_module.ecs_codepipeline.github_webhooks/main.tf line 7, in resource “github_repository_webhook” “default”:resource "github_repository_webhook" "default" {
I’m not sure if this is related. According to the documentation, the /repos/{owner}/{repo}/hooks
URL should exist. But indeed, curl -I https://api.github.com/repos/MyOrg/my-repo/hooks
returns 404 from my desktop as well.
Please correct me if I’m wrong, but it seems like the failing step is Terraform reaching out to GitHub to create a webhook on behalf of AWS so that CodePipeline will be notified when a new commit is pushed. The docs say that an auth error would result in a 403, so it really does seem like the GitHub URL doesn’t exist.
Can anyone advise if there are any steps I need to take on the GitHub side for the webhook creation URL to be present? I’ve provided a PAT with both repo
and admin:repo_hook
permissions. Still, it seems like the endpoint is simply missing.