Refactor all_services to remove name attribute
This commit is contained in:
parent
6f9f888478
commit
1d14ac888e
16 changed files with 42 additions and 71 deletions
modules/services
|
@ -53,9 +53,9 @@ resource "authentik_group" "minio_users" {
|
|||
|
||||
resource "authentik_provider_oauth2" "service_providers" {
|
||||
for_each = local.services_auth
|
||||
name = each.value.name
|
||||
name = each.key
|
||||
client_type = "confidential"
|
||||
client_id = each.value.name
|
||||
client_id = each.key
|
||||
authorization_flow = data.authentik_flow.default_authorization_flow.id
|
||||
redirect_uris = each.value.auth_redirects
|
||||
property_mappings = flatten([
|
||||
|
@ -69,7 +69,7 @@ resource "authentik_provider_oauth2" "service_providers" {
|
|||
|
||||
resource "authentik_application" "service_applications" {
|
||||
for_each = local.services_auth
|
||||
name = each.value.name
|
||||
name = each.key
|
||||
slug = replace(each.value.dns[0].domain, ".", "-")
|
||||
protocol_provider = authentik_provider_oauth2.service_providers[each.key].id
|
||||
}
|
||||
|
|
|
@ -6,13 +6,13 @@ resource "random_password" "postgresql_service_passwords" {
|
|||
|
||||
resource "postgresql_role" "service_roles" {
|
||||
for_each = local.services_database
|
||||
name = each.value.name
|
||||
name = each.key
|
||||
login = true
|
||||
password = random_password.postgresql_service_passwords[each.key].result
|
||||
}
|
||||
|
||||
resource "postgresql_database" "service_databases" {
|
||||
for_each = local.services_database
|
||||
name = each.value.name
|
||||
name = each.key
|
||||
owner = postgresql_role.service_roles[each.key].name
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@ variable "authentik_url" {
|
|||
|
||||
variable "services" {
|
||||
type = map(object({
|
||||
name = string
|
||||
host = string
|
||||
dns = optional(list(object({
|
||||
domain = string
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue