Add github_organization_ip_allow_list_entry resource#3443
Open
allandegnan wants to merge 2 commits into
Open
Conversation
|
👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with |
Adds a managed resource that mirrors github_enterprise_ip_allow_list_entry but is scoped to the organization configured on the provider. Uses the createIpAllowListEntry / updateIpAllowListEntry / deleteIpAllowListEntry GraphQL mutations with the organization node ID as the owner. Includes a tfplugindocs template at templates/resources/ and the generated docs file under docs/resources/, plus an example_1.tf alongside. Closes integrations#1067
ad0eb28 to
2faba29
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #1067
Before the change?
github_organization_ip_allow_listas a data sourceonly. There is no managed resource for organization-scoped IP allow list
entries — only the enterprise-scoped equivalent
(
github_enterprise_ip_allow_list_entry, added in feat: Adding github_enterprise_ip_allow_list_entry resource #2649). Practitioners onplans without enterprise access have had to fall back to the third-party
form3tech-oss/githubipallowlistprovider or tonull_resource+gh api graphqlshims.After the change?
github_organization_ip_allow_list_entrythat creates,updates, deletes, and imports organization-scoped IP allow list entries.
owner, matching theexisting
github_organization_ip_allow_listdata source.createIpAllowListEntry/updateIpAllowListEntry/deleteIpAllowListEntrymutations — same mutations the enterprise resourceuses, with the organization node ID as
ownerId.getOrganizationIDhelper inutil_v4.go(mirrorsgetEnterpriseID).templates/resources/organization_ip_allow_list_entry.md.tmpl; example atexamples/resources/organization_ip_allow_list_entry/example_1.tf.Pull request checklist
Does this introduce a breaking change?
Implementation notes
Near-mechanical adaptation of #2649:
resource_github_enterprise_ip_allow_list_entry.goresource_github_organization_ip_allow_list_entry.goenterprise_slugschema arg →getEnterpriseIDowner→ newgetOrganizationID... on Enterprise { Slug }... on Organization { Login }createIpAllowListEntry/updateIpAllowListEntry/deleteIpAllowListEntryownerIddiffersAcceptance test coverage mirrors #2649: a
basicsubtest (apply +ImportStateVerify) and anupdatesubtest.Test plan
go build ./...cleango vet ./...cleangofmt -l github/cleanmake validatedocsexits 0TF_ACC=1 go test ./github -run TestAccGithubOrganizationIpAllowListEntry— verified against an org with IP allow list enabledDesign note
The resource takes its organization implicitly from the provider's
owner,with no per-resource
ownerargument. This matches thegithub_organization_ip_allow_listdata source and most other org-scopedresources. The alternative (explicit
ownerfield, asform3tech-oss/githubipallowlistdoes) was considered; happy to switch ifreviewers prefer.
Related: #3154 (IP-allow-list trifecta: enterprise / org / GitHub App).