Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT]: github_enterprise_actions_runner_group / github_actions_runner_group - Support network configuration #2302

Open
1 task done
audunsolemdal opened this issue Jun 28, 2024 · 0 comments
Labels
Status: Up for grabs Issues that are ready to be worked on by anyone Type: Feature New feature or request

Comments

@audunsolemdal
Copy link

audunsolemdal commented Jun 28, 2024

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.

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

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

Enterprise:

Github team:

SDK Version

No response

API Version

No response

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@audunsolemdal audunsolemdal added Status: Triage This is being looked at and prioritized Type: Feature New feature or request labels Jun 28, 2024
@audunsolemdal audunsolemdal changed the title [FEAT]: github_enterprise_actions_runner_group - Support network configurations and static IP [FEAT]: github_enterprise_actions_runner_group - Support network configuration Jun 28, 2024
@audunsolemdal audunsolemdal changed the title [FEAT]: github_enterprise_actions_runner_group - Support network configuration [FEAT]: github_enterprise_actions_runner_group / github_actions_runner_group - Support network configuration Jun 28, 2024
@kfcampbell kfcampbell added Status: Up for grabs Issues that are ready to be worked on by anyone and removed Status: Triage This is being looked at and prioritized labels Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Up for grabs Issues that are ready to be worked on by anyone Type: Feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants