From 3decf718d851db248ef40496d6f8d0e8279fcd4c Mon Sep 17 00:00:00 2001 From: Joseph Ivie Date: Mon, 9 Oct 2023 10:51:15 -0600 Subject: [PATCH] Terraform update --- .../lightningserver/aws/terraform.kt | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/server-aws/src/main/kotlin/com/lightningkite/lightningserver/aws/terraform.kt b/server-aws/src/main/kotlin/com/lightningkite/lightningserver/aws/terraform.kt index 9c1e68b5..5c6fb022 100644 --- a/server-aws/src/main/kotlin/com/lightningkite/lightningserver/aws/terraform.kt +++ b/server-aws/src/main/kotlin/com/lightningkite/lightningserver/aws/terraform.kt @@ -1,5 +1,6 @@ package com.lightningkite.lightningserver.aws +import com.lightningkite.lightningserver.auth.JwtSigner import com.lightningkite.lightningserver.cache.CacheSettings import com.lightningkite.lightningserver.db.DatabaseSettings import com.lightningkite.lightningserver.email.EmailSettings @@ -718,6 +719,34 @@ internal fun handlers() { """.trimIndent() } ) + TerraformHandler.handler( + inputs = { key -> + listOf( + TerraformInput.string("${key}_expiration", "PT8760H"), + TerraformInput.string("${key}_emailExpiration", "PT1H"), + ) + }, + emit = { + appendLine( + """ + resource "random_password" "${key}" { + length = 32 + special = true + override_special = "!#${'$'}%&*()-_=+[]{}<>:?" + } + """.trimIndent() + ) + }, + settingOutput = { key -> + """ + { + expiration = var.${key}_expiration + emailExpiration = var.${key}_emailExpiration + secret = random_password.${key}.result + } + """.trimIndent() + } + ) TerraformHandler.handler( inputs = { key -> listOf(