Expected Behavior
Create github_team_repository resource with teamId or slug starting with 0.
Actual Behavior
We have hundreds of teams which both team_id and slug starts with 0.
When creating github_team_repository resource, teamId is being converted from a string to an integer, and team IDs that start with zero are being automatically altered. For example, if teamId is 000123, it is converted to 123 when the API request is made.
I think the snippet below is affecting to this issue when creating the resource
d.SetId(buildTwoPartID(strconv.FormatInt(teamId, 10), repoName))
Only creating the resource is the issue, read / update / delete action does not change the string format.
Terraform Version
Terraform v1.9.8
on linux_amd64
and
Terraform v1.13.2
on darwin_arm64
Affected Resource(s)
Terraform Configuration Files
Steps to Reproduce
Sample resource block
resource "github_team_repository" "team_repo" {
for_each = { for k, v in local.collab : v.team_id => v }
team_id = local.collab.team_id
repository = local.collab.repository
permission = local.collab.permission
}
locals {
collab = {
team_id = "000123"
repository = {REPO}
permission = "pull"
}
}
When applying:
github_team_repository.team_repo["000123"]: Creating...
Error: PUT https://{GITHUB_HOST}/api/v3/organizations/{ORG}/team/123/repos/{OWNER}/{REPO}: 404 Not Found []
with github_team_repository.team_repo["000123"]:
1 : resource "github_team_repository" "team_repo" {
Operation failed: failed running terraform apply (exit 1)
Debug Output
Panic Output
Code of Conduct
Expected Behavior
Create
github_team_repositoryresource withteamIdorslugstarting with 0.Actual Behavior
We have hundreds of teams which both
team_idandslugstarts with 0.When creating
github_team_repositoryresource,teamIdis being converted from a string to an integer, and team IDs that start with zero are being automatically altered. For example, ifteamIdis000123, it is converted to123when the API request is made.I think the snippet below is affecting to this issue when creating the resource
Only creating the resource is the issue, read / update / delete action does not change the string format.
Terraform Version
Terraform v1.9.8
on linux_amd64
and
Terraform v1.13.2
on darwin_arm64
Affected Resource(s)
Terraform Configuration Files
Steps to Reproduce
Sample resource block
When applying:
Debug Output
Panic Output
Code of Conduct