Skip to content

Commit

Permalink
Add mailgun env variables
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikmokki committed Sep 2, 2024
1 parent 1c78f79 commit 310f935
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 1 deletion.
5 changes: 5 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,11 @@ module "web" {
public_laskugeneraattori_url = "https://${module.invoicing.fqdn}"
public_legacy_url = "https://tietokilta.fi"
digitransit_subscription_key = module.keyvault.secrets["digitransit-subscription-key"]
mailgun_sender = module.keyvault.secrets["mailgun-server"]
mailgun_receiver = module.keyvault.secrets["mailgun-receiver"]
mailgun_api_key = module.keyvault.secrets["mailgun-api-key"]
mailgun_domain = module.keyvault.secrets["mailgun-domain"]
mailgun_url = module.keyvault.secrets["mailgun-url"]
}
resource "azurerm_key_vault_secret" "cms_password" {
name = "cms-password"
Expand Down
8 changes: 7 additions & 1 deletion modules/keyvault/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,13 @@ locals {
"muistinnollaus-paytrail-secret-key",
"mongodb-atlas-public-key",
"mongodb-atlas-private-key",
"github-challenge-value"
"github-challenge-value",
"digitransit-subscription-key",
"mailgun-server",
"mailgun-receiver",
"mailgun-api-key",
"mailgun-domain",
"mailgun-url"
]
}

Expand Down
5 changes: 5 additions & 0 deletions modules/web/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ resource "azurerm_linux_web_app" "cms" {
AZURE_DOCUMENTS_STORAGE_CONTAINER_NAME = azurerm_storage_container.documents_container.name
GOOGLE_OAUTH_CLIENT_ID = var.google_oauth_client_id
GOOGLE_OAUTH_CLIENT_SECRET = var.google_oauth_client_secret
MAILGUN_SENDER = var.mailgun_sender
MAILGUN_RECEIVER = var.mailgun_receiver
MAILGUN_API_KEY = var.mailgun_api_key
MAILGUN_DOMAIN = var.mailgun_domain
MAILGUN_URL = var.mailgun_url
}
}

Expand Down
25 changes: 25 additions & 0 deletions modules/web/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,28 @@ variable "digitransit_subscription_key" {
type = string
sensitive = true
}

variable "mailgun_sender" {
type = string
sensitive = true
}

variable "mailgun_receiver" {
type = string
sensitive = true
}

variable "mailgun_api_key" {
type = string
sensitive = true
}

variable "mailgun_domain" {
type = string
sensitive = true
}

variable "mailgun_url" {
type = string
sensitive = true
}

0 comments on commit 310f935

Please sign in to comment.