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 +}