mirror of
https://github.com/jjbrunton/Sauci.git
synced 2026-10-31 18:19:43 +00:00
Fix Terraform type coercion in SMTP settings merge
Separate string and numeric settings into different locals to prevent merge() from coercing integers to strings. The Supabase API requires rate_limit_email_sent to be an integer. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c309fbaa98
commit
4b6df665f3
1 file changed
+12
-8
@@ -207,19 +207,23 @@ locals {
|
||||
# require Team plan or higher - omitted to avoid 402 errors
|
||||
}
|
||||
|
||||
# Production-only SMTP settings (completely omitted for non-prod)
|
||||
auth_smtp = var.is_production ? {
|
||||
smtp_admin_email = "team@send.sauci.app"
|
||||
smtp_host = "smtp.resend.com"
|
||||
# Production-only SMTP string settings (completely omitted for non-prod)
|
||||
auth_smtp_strings = var.is_production ? {
|
||||
smtp_admin_email = "team@send.sauci.app"
|
||||
smtp_host = "smtp.resend.com"
|
||||
smtp_port = "465"
|
||||
smtp_sender_name = "Sauci App"
|
||||
smtp_user = "resend"
|
||||
} : {}
|
||||
|
||||
# Production-only numeric settings (separate to preserve int type)
|
||||
auth_smtp_numbers = var.is_production ? {
|
||||
smtp_max_frequency = 1
|
||||
smtp_port = "465"
|
||||
smtp_sender_name = "Sauci App"
|
||||
smtp_user = "resend"
|
||||
rate_limit_email_sent = 25
|
||||
} : {}
|
||||
|
||||
# Final merged auth config
|
||||
auth_config = merge(local.auth_base, local.auth_smtp)
|
||||
auth_config = merge(local.auth_base, local.auth_smtp_strings, local.auth_smtp_numbers)
|
||||
}
|
||||
|
||||
resource "supabase_settings" "main" {
|
||||
|
||||
Reference in new issue
Block a user