Receiving below error while trying to create a github repo using terraform Error below. Can some help help me to understand what am i missing here?
Error: POST https://api.github.com/repos/github/terraform-module-template/generate: 404 Not Found []
My script below
terraform {
required_providers {
github = {
source = "integrations/github"
version = "4.29.0"
}
}
}
provider "github" {
token = "PAT here"
}
resource "github_repository" "byterraform" {
name = "byterraform"
description = "Repo created by terraform script"
visibility = "private"
template {
owner = "github"
repository = "terraform-module-template"
}
}
Issue is due to template code i.e.
Remove below lines from code
template {
owner = "github"
repository = "terraform-module-template"
}
since this code is trying to refer a template file but is unable to find one since there is none being passed to terraform, hence it gave 404 error.
Faced similar issue. Solved by:
provider "github" { token = "Re-generated github token" }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With