Skip to content

Conversation

@austenstone
Copy link

@austenstone austenstone commented Nov 14, 2025

Overview

This PR adds a new github_organization_network_configuration resource to manage GitHub organization network configurations for hosted compute services (GitHub Actions hosted runners).

⚠️ This PR depends on #2891 (go-github v77 upgrade) being merged first.

API Documentation


Before the change?

  • No Terraform resource existed for managing organization network configurations
  • Users had to manually configure network settings through the GitHub UI or API calls
  • No declarative way to manage hosted compute network configurations

After the change?

  • New github_organization_network_configuration resource enables full CRUD operations
  • Supports configuration management for GitHub Actions hosted runners
  • Declarative infrastructure-as-code for network settings

What does this PR add?

New Resource: github_organization_network_configuration

Schema:

  • name (Required) - Network configuration name (1-100 chars, alphanumeric + ._-)
  • compute_service (Optional) - Hosted compute service: none or actions (default: none)
  • network_settings_ids (Required) - Exactly one network settings ID
  • id (Computed) - Network configuration ID
  • created_on (Computed) - Creation timestamp

Features:

  • ✅ Full CRUD operations using go-github v77 SDK methods
  • ✅ Validation at both Terraform and API levels
  • ✅ Import support
  • ✅ Proper error handling (404 detection, state removal)
  • ✅ Organization-level only (validates with checkOrganization())
  • ✅ Comprehensive test suite (create, update, import scenarios)

Example Usage:

resource "github_organization_network_configuration" "example" {
  name                  = "my-network-config"
  compute_service       = "actions"
  network_settings_ids  = ["abc123def456"]
}

Files Added:

  • github/resource_github_organization_network_configuration.go - Resource implementation
  • github/resource_github_organization_network_configuration_test.go - Test suite
  • Updated github/provider.go - Resource registration

Pull request checklist

  • Tests for the changes have been added
  • Code follows existing patterns and conventions
  • Docs have been added
  • Schema uses proper validation
  • Import functionality implemented and tested

Does this introduce a breaking change?

  • No

Dependencies

This PR requires #2891 to be merged first - The go-github v77 upgrade adds the OrganizationsService network configuration methods that this resource depends on:

  • CreateNetworkConfiguration()
  • GetNetworkConfiguration()
  • UpdateNetworkConfiguration()
  • DeleteNetworkConfigurations()

Additional Notes

  • This resource is for Enterprise Cloud organizations only (network configurations feature)
  • Compute service enum is limited to none and actions for organization-level configs
  • Network settings IDs must be obtained separately (typically from Azure/cloud provider integration)
  • Tests validated successfully (compilation verified after temporarily moving conflicting v77 upgrade test files)

nickfloyd and others added 14 commits November 13, 2025 11:18
- Implements CRUD operations for GitHub organization network configurations
- Supports configuration of network settings for hosted compute (Actions)
- Validates name format (alphanumeric, '.', '-', '_') and length (1-100 chars)
- Enforces compute_service enum ('none', 'actions')
- Requires exactly one network_settings_id
- Includes comprehensive test suite with create, update, and import tests
- Depends on go-github v77 (merged from PR integrations#2891)

Resolves network configuration management for GitHub Actions hosted runners
and other hosted compute services at the organization level.
@github-actions github-actions bot added the Type: Feature New feature or request label Nov 14, 2025
@austenstone austenstone changed the title Feature/GitHub organization network configurations Add github_organization_network_configuration resource Nov 14, 2025
@austenstone austenstone changed the title Add github_organization_network_configuration resource feat: Add github_organization_network_configuration resource Nov 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants