Skip to content

Commit

Permalink
remove session manager 04
Browse files Browse the repository at this point in the history
  • Loading branch information
Krusty93 committed Dec 17, 2024
1 parent 84a4a08 commit 6c8c8d7
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 193 deletions.
5 changes: 0 additions & 5 deletions src/common/_modules/application_gateway/data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ data "azurerm_linux_web_app" "session_manager_03" {
resource_group_name = "io-p-weu-session-manager-rg-01"
}

data "azurerm_linux_web_app" "session_manager_04" {
name = "io-p-weu-session-manager-app-04"
resource_group_name = "io-p-weu-session-manager-rg-01"
}

data "azurerm_linux_web_app" "fims_op_app" {
name = "io-p-itn-fims-op-app-01"
resource_group_name = "io-p-itn-fims-rg-01"
Expand Down
1 change: 0 additions & 1 deletion src/common/_modules/application_gateway/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ module "app_gw" {
ip_addresses = null # with null value use fqdns
fqdns = [
data.azurerm_linux_web_app.session_manager_03.default_hostname,
data.azurerm_linux_web_app.session_manager_04.default_hostname
]
probe = "/healthcheck"
probe_name = "probe-session-manager-app"
Expand Down
69 changes: 0 additions & 69 deletions src/domains/citizen-auth-app/01_network.tf
Original file line number Diff line number Diff line change
Expand Up @@ -144,28 +144,6 @@ module "session_manager_snet" {
}
}

module "session_manager_snet_04" {
source = "github.com/pagopa/terraform-azurerm-v3//subnet?ref=v8.22.0"
name = format("%s-session-manager-snet-04", local.common_project)
address_prefixes = var.cidr_subnet_session_manager_04
resource_group_name = data.azurerm_virtual_network.common_vnet.resource_group_name
virtual_network_name = data.azurerm_virtual_network.common_vnet.name

private_endpoint_network_policies_enabled = true

service_endpoints = [
"Microsoft.Web",
]

delegation = {
name = "default"
service_delegation = {
name = "Microsoft.Web/serverFarms"
actions = ["Microsoft.Network/virtualNetworks/subnets/action"]
}
}
}

#########################
# Private Endpoints
#########################
Expand All @@ -191,27 +169,6 @@ resource "azurerm_private_endpoint" "session_manager_sites" {
tags = var.tags
}

resource "azurerm_private_endpoint" "session_manager_sites_04" {
name = "${local.common_project}-session-manager-app-pep-04"
location = var.location
resource_group_name = azurerm_resource_group.session_manager_rg_weu.name
subnet_id = data.azurerm_subnet.private_endpoints_subnet.id

private_service_connection {
name = "${local.common_project}-session-manager-app-pep-04"
private_connection_resource_id = module.session_manager_weu_04.id
is_manual_connection = false
subresource_names = ["sites"]
}

private_dns_zone_group {
name = "private-dns-zone-group"
private_dns_zone_ids = [data.azurerm_private_dns_zone.privatelink_azurewebsites_net.id]
}

tags = var.tags
}

resource "azurerm_private_endpoint" "staging_session_manager_sites" {
name = "${local.common_project}-session-manager-staging-app-pep-01"
location = var.location
Expand All @@ -233,27 +190,6 @@ resource "azurerm_private_endpoint" "staging_session_manager_sites" {
tags = var.tags
}

resource "azurerm_private_endpoint" "staging_session_manager_sites_04" {
name = "${local.common_project}-session-manager-staging-app-pep-04"
location = var.location
resource_group_name = azurerm_resource_group.session_manager_rg_weu.name
subnet_id = data.azurerm_subnet.private_endpoints_subnet.id

private_service_connection {
name = "${local.common_project}-session-manager-staging-app-pep-04"
private_connection_resource_id = module.session_manager_weu_04.id
is_manual_connection = false
subresource_names = ["sites-${module.session_manager_weu_staging_04.name}"]
}

private_dns_zone_group {
name = "private-dns-zone-group"
private_dns_zone_ids = [data.azurerm_private_dns_zone.privatelink_azurewebsites_net.id]
}

tags = var.tags
}

data "azurerm_nat_gateway" "nat_gateway" {
name = "${local.product}-natgw"
resource_group_name = format("%s-rg-common", local.product)
Expand All @@ -264,11 +200,6 @@ resource "azurerm_subnet_nat_gateway_association" "session_manager_snet" {
subnet_id = module.session_manager_snet.id
}

resource "azurerm_subnet_nat_gateway_association" "session_manager_snet_04" {
nat_gateway_id = data.azurerm_nat_gateway.nat_gateway.id
subnet_id = module.session_manager_snet_04.id
}

data "azurerm_resource_group" "rg_external" {
name = format("%s-rg-external", local.product)
}
Expand Down
88 changes: 0 additions & 88 deletions src/domains/citizen-auth-app/08_session_manager.tf
Original file line number Diff line number Diff line change
Expand Up @@ -284,53 +284,6 @@ module "session_manager_weu" {
tags = var.tags
}

module "session_manager_weu_04" {
source = "github.com/pagopa/terraform-azurerm-v3//app_service?ref=v8.28.1"

# App service plan
plan_type = "internal"
plan_name = format("%s-session-manager-asp-04", local.common_project)
zone_balancing_enabled = true
sku_name = var.session_manager_plan_sku_name

# App service
name = "${local.app_name_weu}-04"
resource_group_name = azurerm_resource_group.session_manager_rg_weu.name
location = var.location

always_on = true
node_version = "20-lts"
# NOTE:
# 1. index.js file is generated from the deploy pipeline
# 2. the linux container for app services already has pm2 installed
# (refer to https://learn.microsoft.com/en-us/azure/app-service/configure-language-nodejs?pivots=platform-linux#run-with-pm2)
app_command_line = "pm2 start index.js -i max --no-daemon"
health_check_path = "/healthcheck"
health_check_maxpingfailures = 2

auto_heal_enabled = true
auto_heal_settings = {
startup_time = "00:05:00"
slow_requests_count = 50
slow_requests_interval = "00:01:00"
slow_requests_time = "00:00:10"
}

app_settings = merge(
local.app_settings_common,
{
APPINSIGHTS_CLOUD_ROLE_NAME = "${local.app_name_weu}-04"
}
)
sticky_settings = concat(["APPINSIGHTS_CLOUD_ROLE_NAME"])

subnet_id = module.session_manager_snet_04.id
vnet_integration = true
public_network_access_enabled = false

tags = var.tags
}

## staging slot
module "session_manager_weu_staging" {
source = "github.com/pagopa/terraform-azurerm-v3//app_service_slot?ref=v8.28.1"
Expand Down Expand Up @@ -383,44 +336,3 @@ module "session_manager_weu_staging" {

tags = var.tags
}

module "session_manager_weu_staging_04" {
source = "github.com/pagopa/terraform-azurerm-v3//app_service_slot?ref=v8.28.1"

app_service_id = module.session_manager_weu_04.id
app_service_name = module.session_manager_weu_04.name

name = "staging"
resource_group_name = azurerm_resource_group.session_manager_rg_weu.name
location = var.location

always_on = true
node_version = "20-lts"
# NOTE:
# 1. index.js file is generated from the deploy pipeline
# 2. the linux container for app services already has pm2 installed
# (refer to https://learn.microsoft.com/en-us/azure/app-service/configure-language-nodejs?pivots=platform-linux#run-with-pm2)
app_command_line = "pm2 start index.js -i max --no-daemon"
health_check_path = "/healthcheck"

auto_heal_enabled = true
auto_heal_settings = {
startup_time = "00:05:00"
slow_requests_count = 50
slow_requests_interval = "00:01:00"
slow_requests_time = "00:00:10"
}

app_settings = merge(
local.app_settings_common,
{
APPINSIGHTS_CLOUD_ROLE_NAME = "${module.session_manager_weu_04.name}-staging"
}
)

subnet_id = module.session_manager_snet_04.id
vnet_integration = true
public_network_access_enabled = false

tags = var.tags
}
12 changes: 0 additions & 12 deletions src/domains/citizen-auth-app/99_variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -181,24 +181,12 @@ variable "cidr_subnet_session_manager" {
description = "Session manager app service address space."
}

variable "cidr_subnet_session_manager_04" {
type = list(string)
description = "Session manager app service instance 4 address space."
}

variable "session_manager_plan_sku_name" {
description = "App service plan sku name"
type = string
default = "P1v3"
}

variable "session_manager_autoscale_settings" {
type = object({
autoscale_minimum = number
autoscale_maximum = number
autoscale_default = number
})
}
####################

# DNS
Expand Down
14 changes: 3 additions & 11 deletions src/domains/citizen-auth-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,8 @@
| <a name="module_function_public_staging_slot_itn"></a> [function\_public\_staging\_slot\_itn](#module\_function\_public\_staging\_slot\_itn) | git::https://github.com/pagopa/terraform-azurerm-v3.git//function_app_slot | v8.44.0 |
| <a name="module_locked_profiles_storage"></a> [locked\_profiles\_storage](#module\_locked\_profiles\_storage) | github.com/pagopa/terraform-azurerm-v3//storage_account | v8.27.0 |
| <a name="module_session_manager_snet"></a> [session\_manager\_snet](#module\_session\_manager\_snet) | github.com/pagopa/terraform-azurerm-v3//subnet | v8.22.0 |
| <a name="module_session_manager_snet_04"></a> [session\_manager\_snet\_04](#module\_session\_manager\_snet\_04) | github.com/pagopa/terraform-azurerm-v3//subnet | v8.22.0 |
| <a name="module_session_manager_weu"></a> [session\_manager\_weu](#module\_session\_manager\_weu) | github.com/pagopa/terraform-azurerm-v3//app_service | v8.28.1 |
| <a name="module_session_manager_weu_04"></a> [session\_manager\_weu\_04](#module\_session\_manager\_weu\_04) | github.com/pagopa/terraform-azurerm-v3//app_service | v8.28.1 |
| <a name="module_session_manager_weu_staging"></a> [session\_manager\_weu\_staging](#module\_session\_manager\_weu\_staging) | github.com/pagopa/terraform-azurerm-v3//app_service_slot | v8.28.1 |
| <a name="module_session_manager_weu_staging_04"></a> [session\_manager\_weu\_staging\_04](#module\_session\_manager\_weu\_staging\_04) | github.com/pagopa/terraform-azurerm-v3//app_service_slot | v8.28.1 |
| <a name="module_shared_snet_itn"></a> [shared\_snet\_itn](#module\_shared\_snet\_itn) | git::https://github.com/pagopa/terraform-azurerm-v3.git//subnet | v8.44.0 |
| <a name="module_tests"></a> [tests](#module\_tests) | ../../_modules/test_users | n/a |

Expand All @@ -62,13 +59,11 @@
| [azurerm_private_endpoint.function_public_itn_sites](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/private_endpoint) | resource |
| [azurerm_private_endpoint.locked_profiles_storage_table](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/private_endpoint) | resource |
| [azurerm_private_endpoint.session_manager_sites](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/private_endpoint) | resource |
| [azurerm_private_endpoint.session_manager_sites_04](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/private_endpoint) | resource |
| [azurerm_private_endpoint.staging_function_lollipop_itn_sites](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/private_endpoint) | resource |
| [azurerm_private_endpoint.staging_function_profile_async_itn_sites](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/private_endpoint) | resource |
| [azurerm_private_endpoint.staging_function_profile_itn_sites](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/private_endpoint) | resource |
| [azurerm_private_endpoint.staging_function_public_itn_sites](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/private_endpoint) | resource |
| [azurerm_private_endpoint.staging_session_manager_sites](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/private_endpoint) | resource |
| [azurerm_private_endpoint.staging_session_manager_sites_04](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/private_endpoint) | resource |
| [azurerm_resource_group.function_profile_async_rg](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group) | resource |
| [azurerm_resource_group.function_profile_rg](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group) | resource |
| [azurerm_resource_group.lollipop_rg_itn](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group) | resource |
Expand All @@ -77,7 +72,6 @@
| [azurerm_storage_table.locked_profiles](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/storage_table) | resource |
| [azurerm_subnet.lollipop_snet_itn](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/subnet) | resource |
| [azurerm_subnet_nat_gateway_association.session_manager_snet](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/subnet_nat_gateway_association) | resource |
| [azurerm_subnet_nat_gateway_association.session_manager_snet_04](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/subnet_nat_gateway_association) | resource |
| [azuread_group.adgroup_admin](https://registry.terraform.io/providers/hashicorp/azuread/latest/docs/data-sources/group) | data source |
| [azuread_group.adgroup_developers](https://registry.terraform.io/providers/hashicorp/azuread/latest/docs/data-sources/group) | data source |
| [azuread_group.adgroup_externals](https://registry.terraform.io/providers/hashicorp/azuread/latest/docs/data-sources/group) | data source |
Expand Down Expand Up @@ -179,7 +173,6 @@
| <a name="input_cidr_subnet_profile_async_itn"></a> [cidr\_subnet\_profile\_async\_itn](#input\_cidr\_subnet\_profile\_async\_itn) | Function app address space. | `list(string)` | n/a | yes |
| <a name="input_cidr_subnet_profile_itn"></a> [cidr\_subnet\_profile\_itn](#input\_cidr\_subnet\_profile\_itn) | Function app address space. | `list(string)` | n/a | yes |
| <a name="input_cidr_subnet_session_manager"></a> [cidr\_subnet\_session\_manager](#input\_cidr\_subnet\_session\_manager) | Session manager app service address space. | `list(string)` | n/a | yes |
| <a name="input_cidr_subnet_session_manager_04"></a> [cidr\_subnet\_session\_manager\_04](#input\_cidr\_subnet\_session\_manager\_04) | Session manager app service instance 4 address space. | `list(string)` | n/a | yes |
| <a name="input_cidr_subnet_shared_1"></a> [cidr\_subnet\_shared\_1](#input\_cidr\_subnet\_shared\_1) | n/a | `list(string)` | n/a | yes |
| <a name="input_dns_zone_io"></a> [dns\_zone\_io](#input\_dns\_zone\_io) | The dns subdomain. | `string` | `null` | no |
| <a name="input_domain"></a> [domain](#input\_domain) | n/a | `string` | n/a | yes |
Expand Down Expand Up @@ -218,11 +211,10 @@
| <a name="input_plan_shared_1_sku_size"></a> [plan\_shared\_1\_sku\_size](#input\_plan\_shared\_1\_sku\_size) | App service plan sku size | `string` | `null` | no |
| <a name="input_plan_shared_1_sku_tier"></a> [plan\_shared\_1\_sku\_tier](#input\_plan\_shared\_1\_sku\_tier) | App service plan sku tier | `string` | `null` | no |
| <a name="input_prefix"></a> [prefix](#input\_prefix) | n/a | `string` | n/a | yes |
| <a name="input_reloader_helm"></a> [reloader\_helm](#input\_reloader\_helm) | reloader helm chart configuration | <pre>object({<br> chart_version = string,<br> image_name = string,<br> image_tag = string<br> })</pre> | n/a | yes |
| <a name="input_session_manager_autoscale_settings"></a> [session\_manager\_autoscale\_settings](#input\_session\_manager\_autoscale\_settings) | n/a | <pre>object({<br> autoscale_minimum = number<br> autoscale_maximum = number<br> autoscale_default = number<br> })</pre> | n/a | yes |
| <a name="input_reloader_helm"></a> [reloader\_helm](#input\_reloader\_helm) | reloader helm chart configuration | <pre>object({<br/> chart_version = string,<br/> image_name = string,<br/> image_tag = string<br/> })</pre> | n/a | yes |
| <a name="input_session_manager_plan_sku_name"></a> [session\_manager\_plan\_sku\_name](#input\_session\_manager\_plan\_sku\_name) | App service plan sku name | `string` | `"P1v3"` | no |
| <a name="input_tags"></a> [tags](#input\_tags) | n/a | `map(any)` | <pre>{<br> "CreatedBy": "Terraform"<br>}</pre> | no |
| <a name="input_tls_cert_check_helm"></a> [tls\_cert\_check\_helm](#input\_tls\_cert\_check\_helm) | tls cert helm chart configuration | <pre>object({<br> chart_version = string,<br> image_name = string,<br> image_tag = string<br> })</pre> | n/a | yes |
| <a name="input_tags"></a> [tags](#input\_tags) | n/a | `map(any)` | <pre>{<br/> "CreatedBy": "Terraform"<br/>}</pre> | no |
| <a name="input_tls_cert_check_helm"></a> [tls\_cert\_check\_helm](#input\_tls\_cert\_check\_helm) | tls cert helm chart configuration | <pre>object({<br/> chart_version = string,<br/> image_name = string,<br/> image_tag = string<br/> })</pre> | n/a | yes |

## Outputs

Expand Down
8 changes: 1 addition & 7 deletions src/domains/citizen-auth-app/env/weu-prod01/terraform.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,7 @@ function_public_autoscale_maximum = 30
function_public_autoscale_default = 10

# Session manager
cidr_subnet_session_manager = ["10.0.149.0/26"]
cidr_subnet_session_manager_04 = ["10.0.149.64/26"]
session_manager_autoscale_settings = {
autoscale_minimum = 3
autoscale_default = 3
autoscale_maximum = 30
}
cidr_subnet_session_manager = ["10.0.149.0/26"]

# DNS
external_domain = "pagopa.it"
Expand Down

0 comments on commit 6c8c8d7

Please sign in to comment.