integrations / integrations/terraform-provider-github

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

Open
#2,626 10 comments 1 reaction 0 assignees View on GitHub
Awaiting response r/team Status: Triage Type: Bug
Dominant language
Go
Stars
1.2k
Forks
1k
Avg merge
1d 14h
Merged PRs (30d)
8

Description

### 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

```hcl
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

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

### Panic Output

```shell

```

### Code of Conduct

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.