Skip to content

Commit

Permalink
Terraform update
Browse files Browse the repository at this point in the history
  • Loading branch information
UnknownJoe796 committed Oct 9, 2023
1 parent 6eeb037 commit 3decf71
Showing 1 changed file with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -718,6 +719,34 @@ internal fun handlers() {
""".trimIndent()
}
)
TerraformHandler.handler<JwtSigner>(
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<SecretBasis>(
inputs = { key ->
listOf(
Expand Down

0 comments on commit 3decf71

Please sign in to comment.