Skip to content

Commit 68cc04e

Browse files
feat: Add github_actions_hosted_runner resource (#2893)
* feat: Add GitHub Actions hosted runner resource and examples * feat: Add documentation for GitHub Actions hosted runner resource * feat: Update GitHub Actions hosted runner resource to use numeric image IDs and add new attributes * feat: Update GitHub Actions hosted runner resource to allow size field updates and enhance validation * feat: Enhance GitHub Actions hosted runner resource to handle image ID as number and add image_gen attribute * Add link to GitHub Actions hosted runner documentation in website * feat: Improve error handling and type assertion in resourceGithubActionsHostedRunnerRead function * lint: Replace interface{} with any in resource_github_actions_hosted_runner.go --------- Co-authored-by: Nick Floyd <[email protected]>
1 parent 5a27fb7 commit 68cc04e

File tree

6 files changed

+1196
-0
lines changed

6 files changed

+1196
-0
lines changed

examples/hosted_runner/main.tf

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
resource "github_actions_runner_group" "example" {
2+
name = "example-runner-group"
3+
visibility = "all"
4+
}
5+
6+
# NOTE: You must first query available images using the GitHub API:
7+
# GET /orgs/{org}/actions/hosted-runners/images/github-owned
8+
# The image ID is numeric, not a string like "ubuntu-latest"
9+
resource "github_actions_hosted_runner" "example" {
10+
name = "example-hosted-runner"
11+
12+
image {
13+
id = "2306" # Ubuntu Latest (24.04) - query your org for available IDs
14+
source = "github"
15+
}
16+
17+
size = "4-core"
18+
runner_group_id = github_actions_runner_group.example.id
19+
}
20+
21+
# Advanced example with optional parameters
22+
resource "github_actions_hosted_runner" "advanced" {
23+
name = "advanced-hosted-runner"
24+
25+
image {
26+
id = "2306" # Ubuntu Latest (24.04) - query your org for available IDs
27+
source = "github"
28+
}
29+
30+
size = "8-core"
31+
runner_group_id = github_actions_runner_group.example.id
32+
maximum_runners = 10
33+
enable_static_ip = true
34+
}

github/provider.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ func Provider() *schema.Provider {
145145
"github_actions_repository_oidc_subject_claim_customization_template": resourceGithubActionsRepositoryOIDCSubjectClaimCustomizationTemplate(),
146146
"github_actions_repository_permissions": resourceGithubActionsRepositoryPermissions(),
147147
"github_actions_runner_group": resourceGithubActionsRunnerGroup(),
148+
"github_actions_hosted_runner": resourceGithubActionsHostedRunner(),
148149
"github_actions_secret": resourceGithubActionsSecret(),
149150
"github_actions_variable": resourceGithubActionsVariable(),
150151
"github_app_installation_repositories": resourceGithubAppInstallationRepositories(),

0 commit comments

Comments
 (0)