Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/terraform.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: terraform

on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
branches:
- main
workflow_dispatch:

jobs:
terraform:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Init
run: terraform init

- name: Linting
run: terraform fmt -recursive -check

- name: Validate
run: terraform validate
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# homelab
[![terraform](https://github.com/guyzsarun-lab/homelab/actions/workflows/terraform.yaml/badge.svg)](https://github.com/guyzsarun-lab/homelab/actions/workflows/terraform.yaml)

## Components
- [Kong](#kong-api-gateway) API Gateway
Expand Down
6 changes: 3 additions & 3 deletions kong/main.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
output "route_k8s" {
value = [
for route in kong-gateway_route.dynamic-app-route : {
id = route.id
name = route.name
id = route.id
name = route.name
hosts = route.hosts[0]
}
]
Expand All @@ -11,7 +11,7 @@ output "route_k8s" {
output "route_service" {
value = [
for service in kong-gateway_route.dynamic-service-route : {
id = service.id
id = service.id
name = service.name
host = service.hosts[0]
}
Expand Down
4 changes: 2 additions & 2 deletions kong/plugin.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ resource "kong-gateway_plugin_prometheus" "prometheus" {
}

enabled = true
instance_name = "prometheus-metrics"
instance_name = "prometheus-metrics"
protocols = [
"https","http"
"https", "http"
]
}
2 changes: 1 addition & 1 deletion kong/route_service.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ resource "kong-gateway_route" "dynamic-service-route" {
for_each = { for service in local.service_route : service.name => service }

name = "${each.value.name}-route"
protocols = ["http","https"]
protocols = ["http", "https"]
hosts = [each.value.host]
paths = []
preserve_host = true
Expand Down