Skip to content

Commit

Permalink
moremore
Browse files Browse the repository at this point in the history
  • Loading branch information
anssihakanen committed Apr 25, 2024
1 parent 9e2814d commit 6ffc439
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 11 deletions.
9 changes: 5 additions & 4 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ module "function_app" {
tags = var.tags
rg = var.rg
location = var.location
pubsa = module.storage.public_storage_account
privsa = module.storage.private_storage_account
private_storage_name = module.storage.private_storage_name
private_storage_key = module.storage.private_storage_key
private_storage_account_id = module.storage.private_storage_account_id
env = var.env
prefix = var.prefix
instru_key = module.monitoring.instrumentation_key
Expand All @@ -37,8 +38,8 @@ module "eventgrid" {
rg = var.rg
prefix = var.prefix
location = var.location
pubsa_id = module.storage.public_storage_account_id
privsa_id = module.storage.private_storage_account_id
public_storage_account_id = module.storage.public_storage_account_id
private_storage_account_id = module.storage.private_storage_account_id
env = var.env
name = var.prefix
function_app_id = module.function_app.function_app_id
Expand Down
6 changes: 3 additions & 3 deletions modules/FunctionApp/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ resource "azurerm_linux_function_app" "function_app" {
location = var.location
resource_group_name = var.rg
service_plan_id = azurerm_service_plan.service_plan.id
storage_account_name = var.privsa.name
storage_account_access_key = var.privsa.primary_access_key
storage_account_name = var.private_storage_name
storage_account_access_key = var.private_storage_key
virtual_network_subnet_id = var.func_subnet_id

site_config {
Expand All @@ -27,7 +27,7 @@ resource "azurerm_linux_function_app" "function_app" {
}
}
app_settings = {
"AzureWebJobsStorage" = "DefaultEndpointsProtocol=https;AccountName=${var.privsa.name};AccountKey=${var.privsa.primary_access_key};EndpointSuffix=core.windows.net"
"AzureWebJobsStorage" = "DefaultEndpointsProtocol=https;AccountName=${var.private_storage_name};AccountKey=${var.private_storage_key};EndpointSuffix=core.windows.net"
"FUNCTIONS_EXTENSION_VERSION" = "~4"
"FUNCTIONS_WORKER_RUNTIME" = "python"
"FUNCTIONS_WORKER_PROCESS_COUNT" = "1"
Expand Down
10 changes: 7 additions & 3 deletions modules/FunctionApp/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,15 @@ variable "tags" {
}


variable "pubsa" {
description = "storage account"
variable "private_storage_name" {
type = string
}

variable "private_storage_key" {
type = string
}

variable "privsa" {
variable "private_storage_account_id" {
description = "storage account"
}

Expand Down
11 changes: 10 additions & 1 deletion modules/Storage/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,13 @@ output public_storage_account_id {

output private_storage_account_id {
value = azurerm_storage_account.private_storage_account.id
}
}

output private_storage_name {
value = azurerm_storage_account.private_storage_account.name
}

output private_storage_key {
value = azurerm_storage_account.private_storage_account.primary_access_key
}

0 comments on commit 6ffc439

Please sign in to comment.