Skip to content

[feature] Manage Organization IP Allow Lists #1067

Description

@douglascayers

Request

Hello, I would like to manage the IP allow list for my GitHub organizations via Terraform. On the web I can do this at https://github.com/organizations/<organization>/settings/security.

What I've checked so far

Desired Configuration

As an example, it would be nice to manage the IP allow lists for an organization something like the following.

locals {
  # For the example, I just grabbed some IPs from https://api.github.com/meta
  cidr_allow_set = [
    "192.30.252.0/22",
    "185.199.108.0/22",
    "140.82.112.0/20",
    "143.55.64.0/20",
  ] 
}

# Per current convention, this new resource infers the organization context from the `provider` configuration.
# This example is inspired by `heroku_space_inbound_ruleset` resource from heroku provider.
# https://registry.terraform.io/providers/heroku/heroku/4.9.0/docs/resources/space_inbound_ruleset
resource "github_organization_ip_allow_list" "default" {
  # For each IP range in the CIDR allow set,
  # creates a `entry { name, active, source }` block.
  dynamic "entry" {
    for_each = local.cidr_allow_set

    content {
      name = "An optional name for the IP allow list entry"
      active = true
      source = entry.value
    }
  }
}

Thank you!


Terraform v1.1.5
on darwin_amd64
+ provider registry.terraform.io/integrations/github v4.20.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: StaleUsed by stalebot to clean house

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions