Describe the need
Currently when managing organization membership with this provider, there is no way to detect when the org's seats are full when running terraform plan, but later terraform apply will fail with You must purchase at least one more seat to add this user as a member. [{Resource: Field:user Code:no_seat Message:}], requiring an organization/enterprise owner to manually add seats before rerunning the apply.
Since the GET /orgs/{org} endpoint of GitHub REST API already returns the available seats (seats) and current filled seats (filled_seats) in the plan struct, as documented here, we can expose them to the github_organization data source as attributes, and let users be able to check them with precondition.
GitHub Installation Type
Relevant log output
* Failed to execute "terraform apply -auto-approve -input=false -lock-timeout=300s -no-color" in ./.terragrunt-cache.../members
Error: PUT https://api.github.com/orgs/my-org/memberships/skywalker: 422 You must purchase at least one more seat to add this user as a member. [{Resource: Field:user Code:no_seat Message:}]
with github_membership.membership["skywalker"],
on members.tf line 1, in resource "github_membership" "membership":
1: resource "github_membership" "membership" {
Code of Conduct
Describe the need
Currently when managing organization membership with this provider, there is no way to detect when the org's seats are full when running
terraform plan, but laterterraform applywill fail withYou must purchase at least one more seat to add this user as a member. [{Resource: Field:user Code:no_seat Message:}], requiring an organization/enterprise owner to manually add seats before rerunning the apply.Since the
GET /orgs/{org}endpoint of GitHub REST API already returns the available seats (seats) and current filled seats (filled_seats) in theplanstruct, as documented here, we can expose them to thegithub_organizationdata source as attributes, and let users be able to check them with precondition.GitHub Installation Type
Relevant log output
Code of Conduct