terraform-provider-github icon indicating copy to clipboard operation
terraform-provider-github copied to clipboard

[BUG]: Create github_team resource causes error when created under EMU EU Data Residency Organization

Open tvriesde opened this issue 7 months ago • 2 comments

Expected Behavior

Hi Team.

We are working on using Terraform for platform automation.

The code at: https://github.com/integrations/terraform-provider-github/blob/6008909a212294e332cb23f3bbaf1089e0d9ed1e/github/util.go#L26

Produces: Error: this resource can only be used in the context of an organization, "org_name" is a user

org_name = the org defined as owner in provider configuration. When running the terraform, the org_name is not a user, but the actual org_name of the customer Enterprise Org to be used as owner.

Version 6.6.0.

Provider definition: https://github.com/orgorgorgorgorg1/platform/blob/main/tf/providers.tf

The code sample in https://github.com/orgorgorgorgorg1/platform/blob/main/tf/ works correctly in the public GH Org used for testing and developing. Then breaks on the error above when used in EMU Data Residency Environment.

Actual Behavior

Org is successfully identified as being an organization. Hence the error not being produced, causing org level automation to break.

Terraform Version

3.7.0

Affected Resource(s)

  • github_teams

Terraform Configuration Files

https://github.com/orgorgorgorgorg1/platform/tree/main/tf

Steps to Reproduce

Create github_teams resource and configure provider to be set to an organization that resides in a GH Enteprise with Data residency & EMU.

Debug Output

Error: this resource can only be used in the context of an organization, "org_name" is a user

Panic Output


Code of Conduct

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

tvriesde avatar Apr 16 '25 09:04 tvriesde

My suspicion is that the library used by this provider does not use the data residency api url, as implemented by the Terraform provider.

https://github.com/google/go-github/tree/master

tvriesde avatar Apr 16 '25 09:04 tvriesde

Same Issue here

felipefrocha avatar May 09 '25 10:05 felipefrocha