I am trying to create teams and repositories via terraform however I get the following error:
Error: POST https://api.github.com/orgs/MyOrgName/repos: 403 Resource not accessible by integration []
I have created an Github App on organization. The Github App has these permissions:
Terraform setups look like below:
provider "github" {
owner = "MyOrgName"
app_auth {
id = "1111" #GITHUB_APP_ID
installation_id = "222222" #GITHUB_APP_INSTALLATION_ID
pem_file = file("private-key.pem")#GITHUB_APP_PEM_FILE
}
}
resource "github_team" "all_teams" {
name = "All Teams"
description = "Parent team for all other teams. Give this team access to your repo to have a transparent code ecosystem."
privacy = "closed"
parent_team_id = null
}
module "repo_terraform-aws-ec2" {
source = "../repository"
name = "terraform-aws-ec2"
description = "Terraform module for EC2 servers"
auto_init = false
has_issues = true
permission_admin_teams = [data.github_team.all_teams]
permission_write_teams = [data.github_team.all_teams]
branch_protection = {
require_signed_commits = false
}
}
Does anyone know what setup I am missing?