mirror of
https://github.com/jjbrunton/Sauci.git
synced 2026-10-31 10: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
+8
-4
@@ -207,19 +207,23 @@ locals {
|
|||||||
# require Team plan or higher - omitted to avoid 402 errors
|
# require Team plan or higher - omitted to avoid 402 errors
|
||||||
}
|
}
|
||||||
|
|
||||||
# Production-only SMTP settings (completely omitted for non-prod)
|
# Production-only SMTP string settings (completely omitted for non-prod)
|
||||||
auth_smtp = var.is_production ? {
|
auth_smtp_strings = var.is_production ? {
|
||||||
smtp_admin_email = "team@send.sauci.app"
|
smtp_admin_email = "team@send.sauci.app"
|
||||||
smtp_host = "smtp.resend.com"
|
smtp_host = "smtp.resend.com"
|
||||||
smtp_max_frequency = 1
|
|
||||||
smtp_port = "465"
|
smtp_port = "465"
|
||||||
smtp_sender_name = "Sauci App"
|
smtp_sender_name = "Sauci App"
|
||||||
smtp_user = "resend"
|
smtp_user = "resend"
|
||||||
|
} : {}
|
||||||
|
|
||||||
|
# Production-only numeric settings (separate to preserve int type)
|
||||||
|
auth_smtp_numbers = var.is_production ? {
|
||||||
|
smtp_max_frequency = 1
|
||||||
rate_limit_email_sent = 25
|
rate_limit_email_sent = 25
|
||||||
} : {}
|
} : {}
|
||||||
|
|
||||||
# Final merged auth config
|
# 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" {
|
resource "supabase_settings" "main" {
|
||||||
|
|||||||
Reference in new issue
Block a user