I have a github provider declared with a personal access token. Trying to create a repository like the following works:
resource "github_repository" "test" {
name = "test"
visibility = "private"
}
However, I want to create something reusable. Whenever I try to create that exact same github_repository
from a submodule, I get the following error:
╷
│ Error: POST https://api.github.com/user/repos: 401 Requires authentication []
│
│ with module.test.module.repository.github_repository.test,
│ on modules\serverless_api_repository\main.tf line 1, in resource "github_repository" "source_code":
│ 1: resource "github_repository" "test" {
│
╵
Why can't I create a github_repository
from a submodule, when it works in the main scope?