feat: add argo workflows

This commit is contained in:
cătălin 2024-03-13 15:20:32 +01:00
commit 2c7de2fb4c
No known key found for this signature in database
11 changed files with 254 additions and 0 deletions

View file

@ -0,0 +1,45 @@
terraform {
required_providers {
authentik = {
source = "goauthentik/authentik"
version = "2024.2.0"
}
}
}
data "authentik_flow" "default-authorization-flow" {
slug = "default-provider-authorization-implicit-consent"
}
data "authentik_scope_mapping" "default-scopes" {
managed_list = [
"goauthentik.io/providers/oauth2/scope-email",
"goauthentik.io/providers/oauth2/scope-openid",
"goauthentik.io/providers/oauth2/scope-profile",
"goauthentik.io/providers/oauth2/scope-offline_access",
]
}
resource "authentik_provider_oauth2" "provider_oidc" {
name = var.app_name
client_id = var.client_id
client_secret = var.client_secret
authorization_flow = data.authentik_flow.default-authorization-flow.id
redirect_uris = var.redirect_uris
property_mappings = data.authentik_scope_mapping.default-scopes.ids
sub_mode = var.sub_mode
signing_key = var.oidc_signing_key
}
resource "authentik_application" "app" {
name = var.app_name
slug = var.app_slug
protocol_provider = authentik_provider_oauth2.provider_oidc.id
}
resource "authentik_policy_binding" "app_access" {
target = authentik_application.app.uuid
group = var.app_access_group_id
order = 0
}