From 8872662212d848e4bf5bfde4115ac4a48fe94c6d Mon Sep 17 00:00:00 2001 From: Yuris Cakranegara Date: Sun, 8 Jun 2025 14:40:44 +1000 Subject: [PATCH] feat: add smtp info --- .env.example | 7 +++++++ modules/00-globals/smtp/main.tf | 35 +++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 modules/00-globals/smtp/main.tf diff --git a/.env.example b/.env.example index 4ecd567..8cca7c5 100644 --- a/.env.example +++ b/.env.example @@ -9,3 +9,10 @@ CLOUDFLARE_API_TOKEN="your-cloudflare-api-token" CLOUDFLARE_ACCOUNT_ID="your-cloudflare-account-id" CLOUDFLARE_ZONE_ID="your-cloudflare-zone-id" DOMAIN="yourdomain.com" + +# SMTP +MAIL_FROM=your-email@example.com +MAIL_HOST=smtp.gmail.com +MAIL_PORT=587 +MAIL_USERNAME=your-email@example.com +MAIL_PASSWORD=your-smtp-password \ No newline at end of file diff --git a/modules/00-globals/smtp/main.tf b/modules/00-globals/smtp/main.tf new file mode 100644 index 0000000..3432915 --- /dev/null +++ b/modules/00-globals/smtp/main.tf @@ -0,0 +1,35 @@ +terraform { + required_providers { + dotenv = { + source = "germanbrew/dotenv" + } + } +} + +data "dotenv" "smtp_config" {} + +// Outputs +output "mail_from" { + description = "Mail from address" + value = data.dotenv.smtp_config.entries.MAIL_FROM +} + +output "mail_host" { + description = "Mail host" + value = data.dotenv.smtp_config.entries.MAIL_HOST +} + +output "mail_port" { + description = "Mail port" + value = data.dotenv.smtp_config.entries.MAIL_PORT +} + +output "mail_username" { + description = "Mail username" + value = data.dotenv.smtp_config.entries.MAIL_USERNAME +} + +output "mail_password" { + description = "Mail password" + value = data.dotenv.smtp_config.entries.MAIL_PASSWORD +}