Skip to content

Commit

Permalink
add private runner
Browse files Browse the repository at this point in the history
  • Loading branch information
Krusty93 committed Apr 15, 2024
1 parent 00d18e5 commit 51cc5fb
Show file tree
Hide file tree
Showing 5 changed files with 126 additions and 0 deletions.
48 changes: 48 additions & 0 deletions infra/github-runner/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions infra/github-runner/container_app_job_runner.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module "container_app_job" {
source = "github.com/pagopa/terraform-azurerm-v3//container_app_job_gh_runner?ref=v7.76.0"

location = local.location
prefix = local.prefix
env_short = local.env_short

key_vault = {
resource_group_name = data.azurerm_key_vault.key_vault_common.resource_group_name
name = data.azurerm_key_vault.key_vault_common.name
secret_name = "github-runner-pat"
}

environment = {
name = data.azurerm_container_app_environment.container_app_environment_runner.name
resource_group_name = data.azurerm_container_app_environment.container_app_environment_runner.resource_group_name
}

job = {
name = "service-messages"
repo = "io-functions-service-messages"
}

tags = local.tags
}
9 changes: 9 additions & 0 deletions infra/github-runner/data.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
data "azurerm_key_vault" "key_vault_common" {
name = local.key_vault_common.name
resource_group_name = local.key_vault_common.resource_group_name
}

data "azurerm_container_app_environment" "container_app_environment_runner" {
name = local.container_app_environment.name
resource_group_name = local.container_app_environment.resource_group_name
}
25 changes: 25 additions & 0 deletions infra/github-runner/locals.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
locals {
location = "westeurope"
prefix = "io"
env_short = "p"
project = "${local.prefix}-${local.env_short}"

key_vault_common = {
name = "${local.project}-kv-common"
resource_group_name = "${local.project}-rg-common"
}

container_app_environment = {
name = "${local.project}-github-runner-cae"
resource_group_name = "${local.project}-github-runner-rg"
}

tags = {
CostCenter = "TS310 - PAGAMENTI & SERVIZI"
CreatedBy = "Terraform"
Environment = "Prod"
Owner = "IO"
ManagementTeam = "IO Comunicazione"
Source = "https://github.com/pagopa/io-functions-service-messages/tree/main/infra/github-runner"
}
}
19 changes: 19 additions & 0 deletions infra/github-runner/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "<= 3.98.0"
}
}

backend "azurerm" {
resource_group_name = "terraform-state-rg"
storage_account_name = "tfappprodio"
container_name = "terraform-state"
key = "io-functions-service-messages.github-runner.tfstate"
}
}

provider "azurerm" {
features {}
}

0 comments on commit 51cc5fb

Please sign in to comment.