Skip to content

[BUG]: Unable to create enterprise organization in EMU enabled enterprise using GitHub App #3267

@brgsstm

Description

@brgsstm

Expected Behavior

Creation of organization using a GitHub App with below permissions over the enterprise:

Enterprise organizations - Read and write
Enterprise people - Read and Write

Actual Behavior

Fails at plan

│ with provider["registry.terraform.io/integrations/github"],
│ on main.tf line 10, in provider "github":
│ 10: provider "github" {

│ GET https://api.github.com/user: 403 Resource not accessible by integration []

Potentially related to this? -

//NOTE: There is some odd behavior here when using an EMU with SSO. If the user token has been granted permission to

Works with a classic PAT with ['admin:enterprise', 'read:user', 'read:org']

Terraform Version

Terraform v1.14.4
on windows_amd64

  • provider registry.terraform.io/integrations/github v6.11.1

Affected Resource(s)

github_enterprise_organization

Terraform Configuration Files

terraform {
  required_providers {
    github = {
      source  = "integrations/github"
      version = "~> 6.0"
    }
  }
}

provider "github" {
  app_auth {
    id              = "xxxxxxx"
    installation_id = "xxxxxxxxx"
    pem_file        = file("xxx.pem")
  }
  base_url = "https://github.com/"
}

data "github_enterprise" "xxxxx" {
  slug = "xxxxx"
}

resource "github_enterprise_organization" "xxxxx_test_org" {
  enterprise_id = data.github_enterprise.xxxxx.id
  name          = "xxx-xxx-xxxx-xxx"
  billing_email = "[email protected]"
  admin_logins = [
    "xxx-xxxxxxxx_xxx"
  ]
}

Steps to Reproduce

terraform plan

Debug Output

Panic Output

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: TriageThis is being looked at and prioritizedType: BugSomething isn't working as documented

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions