Add authentik to opentofu

This commit is contained in:
Tobias Reisinger 2024-09-28 14:14:09 +02:00
parent 496cd360c6
commit 01ee9d4b44
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
9 changed files with 184 additions and 84 deletions

24
main.tf
View file

@ -1,24 +1,28 @@
terraform {
required_providers {
authentik = {
source = "goauthentik/authentik"
version = "~> 2024.8.0"
}
hcloud = {
source = "hetznercloud/hcloud"
version = "~> 1.45"
version = "~> 1.45.0"
}
ovh = {
source = "ovh/ovh"
version = "~> 0.48"
version = "~> 0.48.0"
}
postgresql = {
source = "cyrilgdn/postgresql"
version = "~> 1.23"
version = "~> 1.23.0"
}
scaleway = {
source = "scaleway/scaleway"
version = "~> 2.43"
version = "~> 2.43.0"
}
tailscale = {
source = "tailscale/tailscale"
version = "~> 0.16"
version = "~> 0.16.0"
}
}
@ -41,6 +45,11 @@ terraform {
}
}
provider "authentik" {
url = "${var.authentik_url}"
token = "${var.authentik_token}"
}
provider "hcloud" {
token = "${var.hcloud_token}"
}
@ -75,3 +84,8 @@ provider "tailscale" {
api_key = "${var.tailscale_api_key}"
tailnet = "${var.tailscale_tailnet}"
}
locals {
service_auths = {for key, val in var.services : key => val if val.auth}
}