integrations / integrations/terraform-provider-github

[FEAT]: github_enterprise_actions_runner_group / github_actions_runner_group - Support network configuration

Open
#2,302 21 comments 24 reactions 0 assignees View on GitHub
Type: Feature
Dominant language
Go
Stars
1.2k
Forks
1k
Avg merge
1d 14h
Merged PRs (30d)
8

Description

### Describe the need

For the resources `github_enterprise_actions_runner_group` and `github_actions_runner_group` I would like support for configuring private networking via Terraform. This would help ease setup and maintenance of a great and cost efficient feature.

```hcl

data "github_enterprise" "example" {
slug = "example-co"
}

resource "azapi_resource" "subnet_integration" {
type = "GitHub.Network/networkSettings@2024-04-02"
name = "test-subnet-integration"
location = module.vnet.vnet.location
parent_id = module.vnet.rg.id
schema_validation_enabled = false
body = jsonencode({
properties = {
subnetId = module.vnet.subnets["test-subnet"].id
businessId = data.github_enterprise.example.database_id
}
})

lifecycle {
ignore_changes = [tags]
}
}

resource "github_enterprise_actions_runner_group" "example" {
name = "my-awesome-runner-group"
enterprise_slug = data.github_enterprise.enterprise.slug
selected_organization_ids = [github_enterprise_organization.enterprise_organization.database_id]

# NEW
network_configuration_id = azapi_resource.subnet_integration.tags["GithubId"] # optional
disable_network_configuration = false # optional. Only has an effect if network_configuration_id is set
}

resource "azapi_resource" "subnet_integration2" {
type = "GitHub.Network/networkSettings@2024-04-02"
name = "test-subnet-integration"
location = module.vnet.vnet.location
parent_id = module.vnet.rg.id
schema_validation_enabled = false
body = jsonencode({
properties = {
subnetId = module.vnet.subnets["test-subnet2"].id
businessId = data.github_enterprise.example.database_id
}
})

lifecycle {
ignore_changes = [tags]
}
}

resource "github_actions_runner_group" "example" {
name = "xxx"
selected_repository_ids = ["yyy"]

# NEW
network_configuration_id = azapi_resource.subnet_integration2.tags["GithubId"] # optional
disable_network_configuration = false # optional. Only has an effect if network_configuration_id is set
}

```

Alternatively an optional block can be used to configue this

```hcl
resource "github_actions_runner_group" "example" {
...
network_configuration {
id = azapi_resource.subnet_integration2.tags["GithubId"] # optional
disable_configuration = false # optional, defaults to false
}
...
}
```

Enterprise:
- https://docs.github.com/en/enterprise-cloud@latest/admin/configuring-settings/configuring-private-networking-for-hosted-compute-products/configuring-private-networking-for-github-hosted-runners-in-your-enterprise#1-add-a-new-network-configuration-for-your-enterprise

Github team:
- https://docs.github.com/en/organizations/managing-organization-settings/configuring-private-networking-for-github-hosted-runners-in-your-organization#about-azure-private-networking-for-github-hosted-runners

### SDK Version

_No response_

### API Version

_No response_

### Relevant log output

_No response_

### Code of Conduct

- [X] I agree to follow this project's Code of Conduct

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.