Skip to content

Commit

Permalink
[#IOCIT-176] porting Function Admin v4 (#315)
Browse files Browse the repository at this point in the history
Co-authored-by: Pasquale De Vita <59291437+pasqualedevita@users.noreply.github.com>
Co-authored-by: Michael Disaro <michael.disaro@gmail.com>
Co-authored-by: Michael Disaro <15191694+michaeldisaro@users.noreply.github.com>
  • Loading branch information
4 people authored Dec 28, 2022
1 parent 6c830fb commit b3137a5
Show file tree
Hide file tree
Showing 10 changed files with 493 additions and 25 deletions.
5 changes: 4 additions & 1 deletion src/core/99_locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ locals {
# windows standatd. It can be different in linux service plan.
cet_time_zone_win = "Central Europe Standard Time"

# service_api_url = "http://api-app.internal.pagopa.it"
service_api_url = "https://api-app.internal.io.pagopa.it/"

# Switch limit date for email opt out mode. This value should be used by functions that need to discriminate
# how to check isInboxEnabled property on IO profiles, since we have to disable email notifications for default
Expand All @@ -47,4 +47,7 @@ locals {
hostname = "io-p-evh-ns.servicebus.windows.net"
port = "9093"
}

# MESSAGES
message_content_container_name = "message-content"
}
43 changes: 43 additions & 0 deletions src/core/99_variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,11 @@ variable "cidr_subnet_eucovidcert" {
description = "Function App EUCovidCert address space."
}

variable "cidr_subnet_fnadmin" {
type = list(string)
description = "Function Admin address space."
}

## VPN ##
variable "vpn_sku" {
type = string
Expand Down Expand Up @@ -702,6 +707,44 @@ variable "function_app_async_autoscale_default" {
default = 1
}

# Function Admin

variable "function_admin_kind" {
type = string
description = "App service plan kind"
default = null
}

variable "function_admin_sku_tier" {
type = string
description = "App service plan sku tier"
default = null
}

variable "function_admin_sku_size" {
type = string
description = "App service plan sku size"
default = null
}

variable "function_admin_autoscale_minimum" {
type = number
description = "The minimum number of instances for this resource."
default = 1
}

variable "function_admin_autoscale_maximum" {
type = number
description = "The maximum number of instances for this resource."
default = 3
}

variable "function_admin_autoscale_default" {
type = number
description = "The number of instances that are available for scaling if metrics are not available for evaluation."
default = 1
}

# App Messages
variable "app_messages_count" {
type = number
Expand Down
29 changes: 27 additions & 2 deletions src/core/README.md

Large diffs are not rendered by default.

5 changes: 0 additions & 5 deletions src/core/app_backend.tf
Original file line number Diff line number Diff line change
Expand Up @@ -305,11 +305,6 @@ data "azurerm_key_vault_secret" "app_backend_EUCOVIDCERT_API_KEY" {
key_vault_id = data.azurerm_key_vault.common.id
}

data "azurerm_key_vault_secret" "app_backend_PRE_SHARED_KEY" {
name = "appbackend-PRE-SHARED-KEY"
key_vault_id = data.azurerm_key_vault.common.id
}

data "azurerm_key_vault_secret" "app_backend_ALLOW_PAGOPA_IP_SOURCE_RANGE" {
name = "appbackend-ALLOW-PAGOPA-IP-SOURCE-RANGE"
key_vault_id = data.azurerm_key_vault.common.id
Expand Down
2 changes: 1 addition & 1 deletion src/core/app_messages.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ locals {
COSMOSDB_KEY = data.azurerm_cosmosdb_account.cosmos_api.primary_master_key
COSMOS_API_CONNECTION_STRING = format("AccountEndpoint=%s;AccountKey=%s;", data.azurerm_cosmosdb_account.cosmos_api.endpoint, data.azurerm_cosmosdb_account.cosmos_api.primary_master_key)

MESSAGE_CONTAINER_NAME = "message-content"
MESSAGE_CONTAINER_NAME = local.message_content_container_name
QueueStorageConnection = data.azurerm_storage_account.api.primary_connection_string

// Keepalive fields are all optionals
Expand Down
24 changes: 23 additions & 1 deletion src/core/data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,27 @@ data "azurerm_key_vault_secret" "apim_services_subscription_key" {
key_vault_id = data.azurerm_key_vault.common.id
}

# MAILUP

data "azurerm_key_vault_secret" "common_MAILUP_USERNAME" {
name = "common-MAILUP2-USERNAME"
key_vault_id = data.azurerm_key_vault.common.id
}

data "azurerm_key_vault_secret" "common_MAILUP_SECRET" {
name = "common-MAILUP2-SECRET"
key_vault_id = data.azurerm_key_vault.common.id
}

#
# App Backend shared resources
#

data "azurerm_key_vault_secret" "app_backend_PRE_SHARED_KEY" {
name = "appbackend-PRE-SHARED-KEY"
key_vault_id = data.azurerm_key_vault.common.id
}


# -----------------------------------------------
# Alerts
Expand Down Expand Up @@ -297,4 +318,5 @@ resource "azurerm_monitor_metric_alert" "iopstapi_throttling_low_availability" {
}

tags = var.tags
}
}

9 changes: 9 additions & 0 deletions src/core/env/prod/terraform.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ cidr_subnet_fnpblevtdispatcher = ["10.0.12.0/24"]
cidr_subnet_appgateway = ["10.0.13.0/24"]
cidr_subnet_redis_apim = ["10.0.14.0/24"]
cidr_subnet_shared_1 = ["10.0.16.0/26"]
cidr_subnet_fnadmin = ["10.0.15.0/26"]
cidr_subnet_apim = ["10.0.101.0/24"]
cidr_subnet_appmessages = ["10.0.127.0/24", "10.0.128.0/24"]
cidr_subnet_fnmessagescqrs = ["10.0.129.0/24"]
Expand Down Expand Up @@ -187,6 +188,14 @@ function_app_async_autoscale_minimum = 1
function_app_async_autoscale_maximum = 30
function_app_async_autoscale_default = 10

# Functions Admin
function_admin_kind = "Linux"
function_admin_sku_tier = "PremiumV3"
function_admin_sku_size = "P1v3"
function_admin_autoscale_minimum = 1
function_admin_autoscale_maximum = 3
function_admin_autoscale_default = 1

# Functions Cgn
plan_cgn_kind = "Linux"
plan_cgn_sku_tier = "PremiumV3"
Expand Down
Loading

0 comments on commit b3137a5

Please sign in to comment.