Skip to content

Commit

Permalink
Merge pull request #89 from amido/russellseymour/fix-function-costs
Browse files Browse the repository at this point in the history
[3776] Java - change the way the Azure function infrastructure is deployed
  • Loading branch information
russellseymour authored Oct 12, 2021
2 parents c00775b + d1d4a82 commit 96774f4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 19 deletions.
25 changes: 6 additions & 19 deletions deploy/azure/app/servicebus/function.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,29 +32,16 @@ resource "azurerm_storage_account" "sa_listener" {
}

# The app plans for the functions
resource "azurerm_app_service_plan" "app_sp_publisher" {
name = "service-plan-${var.function-publisher-name}"
resource "azurerm_app_service_plan" "app_sp" {
name = var.app-service-plan-name
resource_group_name = var.resource_group_name
location = var.resource_group_location
kind = "linux"
reserved = true

sku {
tier = "ElasticPremium"
size = "EP1"
}
}

resource "azurerm_app_service_plan" "app_sp_listener" {
name = "service-plan-${var.function-listener-name}"
resource_group_name = var.resource_group_name
location = var.resource_group_location
kind = "linux"
reserved = true

sku {
tier = "ElasticPremium"
size = "EP1"
tier = "Standard"
size = "S1"
}
}

Expand All @@ -67,7 +54,7 @@ resource "azurerm_function_app" "function_publisher" {
azurerm_servicebus_namespace.sb
]

app_service_plan_id = azurerm_app_service_plan.app_sp_publisher.id
app_service_plan_id = azurerm_app_service_plan.app_sp.id
storage_account_name = azurerm_storage_account.sa_publisher.name
storage_account_access_key = azurerm_storage_account.sa_publisher.primary_access_key

Expand All @@ -90,7 +77,7 @@ resource "azurerm_function_app" "function_listener" {
azurerm_servicebus_namespace.sb
]

app_service_plan_id = azurerm_app_service_plan.app_sp_listener.id
app_service_plan_id = azurerm_app_service_plan.app_sp.id
storage_account_name = azurerm_storage_account.sa_listener.name
storage_account_access_key = azurerm_storage_account.sa_listener.primary_access_key

Expand Down
5 changes: 5 additions & 0 deletions deploy/azure/app/servicebus/vars.tf
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ variable "cosmosdb_lease_collection_name" {

# Optional variables
# These have default values that can be overriden as required
variable "app-service-plan-name" {
type = string
default = "app-sp-events"
}

variable "function-publisher-name" {
type = string
default = "function-publisher"
Expand Down

0 comments on commit 96774f4

Please sign in to comment.