Skip to content

Commit

Permalink
feat: Paymcloud 72 printit app (#2591)
Browse files Browse the repository at this point in the history
* upgraded tf provider printit-app
  • Loading branch information
mamari90 authored Nov 25, 2024
1 parent 04f5b5e commit 5bc00f9
Show file tree
Hide file tree
Showing 12 changed files with 73 additions and 38 deletions.
17 changes: 16 additions & 1 deletion src/domains/printit-app/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 12 additions & 7 deletions src/domains/printit-app/01_app_service_pdf_engine.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ data "azurerm_container_registry" "container_registry" {
################

module "printit_pdf_engine_app_service" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//app_service?ref=v8.18.0"
count = var.is_feature_enabled.pdf_engine ? 1 : 0
source = "./.terraform/modules/__v3__/app_service"

count = var.is_feature_enabled.pdf_engine ? 1 : 0

vnet_integration = false
resource_group_name = azurerm_resource_group.printit_pdf_engine_app_service_rg.name
Expand All @@ -36,6 +37,9 @@ module "printit_pdf_engine_app_service" {

health_check_path = "/info"

ip_restriction_default_action = var.app_service_ip_restriction_default_action


app_settings = local.printit_pdf_engine_app_settings

zone_balancing_enabled = var.app_service_pdf_engine_zone_balancing_enabled
Expand All @@ -51,7 +55,7 @@ module "printit_pdf_engine_app_service" {
module "printit_pdf_engine_slot_staging" {
count = var.env_short != "d" && var.is_feature_enabled.pdf_engine ? 1 : 0

source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//app_service_slot?ref=v8.18.0"
source = "./.terraform/modules/__v3__/app_service_slot"

# App service plan
# app_service_plan_id = module.printit_pdf_engine_app_service.plan_id
Expand Down Expand Up @@ -249,7 +253,7 @@ resource "azurerm_monitor_autoscale_setting" "autoscale_app_service_printit_pdf_
#java
###############
module "printit_pdf_engine_app_service_java" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//app_service?ref=v8.18.0"
source = "./.terraform/modules/__v3__/app_service"
count = var.is_feature_enabled.pdf_engine ? 1 : 0

vnet_integration = false
Expand All @@ -272,8 +276,9 @@ module "printit_pdf_engine_app_service_java" {

app_settings = local.printit_pdf_engine_app_settings_java

allowed_subnets = [data.azurerm_subnet.apim_vnet.id]
allowed_ips = []
ip_restriction_default_action = var.app_service_ip_restriction_default_action
allowed_subnets = [data.azurerm_subnet.apim_vnet.id]
allowed_ips = []

subnet_id = data.azurerm_subnet.printit_pdf_engine_app_service_snet[0].id

Expand All @@ -285,7 +290,7 @@ module "printit_pdf_engine_app_service_java" {
module "printit_pdf_engine_java_slot_staging" {
count = var.env_short != "d" && var.is_feature_enabled.pdf_engine ? 1 : 0

source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//app_service_slot?ref=v8.18.0"
source = "./.terraform/modules/__v3__/app_service_slot"

# App service plan
# app_service_plan_id = module.printit_pdf_engine_app_service.plan_id
Expand Down
2 changes: 1 addition & 1 deletion src/domains/printit-app/02_namespace.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ resource "kubernetes_namespace" "namespace" {
}

module "pod_identity" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//kubernetes_pod_identity?ref=v8.18.0"
source = "./.terraform/modules/__v3__/kubernetes_pod_identity"

resource_group_name = local.aks_resource_group_name
location = var.location
Expand Down
2 changes: 1 addition & 1 deletion src/domains/printit-app/03_serviceaccounts_azure_devops.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ resource "kubernetes_namespace" "namespace_system" {
}

module "kubernetes_service_account" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//kubernetes_service_account?ref=v8.18.0"
source = "./.terraform/modules/__v3__/kubernetes_service_account"
name = "azure-devops"
namespace = "${var.domain}-system"
}
Expand Down
4 changes: 2 additions & 2 deletions src/domains/printit-app/04_apim_notice_blob.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ locals {
module "apim_notices_blob_product" {
count = var.is_feature_enabled.printit ? 1 : 0

source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//api_management_product?ref=v8.33.0"
source = "./.terraform/modules/__v3__/api_management_product"

product_id = "pagopa-notices-blob"
display_name = "Payment Notices Blob Storage"
Expand Down Expand Up @@ -44,7 +44,7 @@ resource "azurerm_api_management_api_version_set" "apim_notices_blob_api" {

module "apim_notices_blob_api_v1" {
count = var.is_feature_enabled.printit ? 1 : 0
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//api_management_api?ref=v8.33.0"
source = "./.terraform/modules/__v3__/api_management_api"

name = "${var.env_short}-notices-blob-api"
api_management_name = local.pagopa_apim_name
Expand Down
2 changes: 1 addition & 1 deletion src/domains/printit-app/04_apim_notice_generator.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ locals {
}

module "apim_notices_generator_product" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//api_management_product?ref=v8.18.0"
source = "./.terraform/modules/__v3__/api_management_product"
count = var.is_feature_enabled.printit ? 1 : 0

product_id = "pagopa_notices_generator"
Expand Down
4 changes: 2 additions & 2 deletions src/domains/printit-app/04_apim_notice_service.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ locals {
}

module "apim_notices_service_product_external" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//api_management_product?ref=v8.18.0"
source = "./.terraform/modules/__v3__/api_management_product"
count = var.is_feature_enabled.printit ? 1 : 0

product_id = "pagopa_notices_service_external"
Expand All @@ -30,7 +30,7 @@ module "apim_notices_service_product_external" {
}

module "apim_notices_service_product_internal" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//api_management_product?ref=v8.18.0"
source = "./.terraform/modules/__v3__/api_management_product"
count = var.is_feature_enabled.printit ? 1 : 0

product_id = "pagopa_notices_service_internal"
Expand Down
6 changes: 3 additions & 3 deletions src/domains/printit-app/04_apim_pdf_engine.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
##############

module "apim_pdf_engine_product" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//api_management_product?ref=v8.18.0"
source = "./.terraform/modules/__v3__/api_management_product"
count = var.is_feature_enabled.pdf_engine ? 1 : 0

product_id = "pdf-engine-printit"
Expand Down Expand Up @@ -58,7 +58,7 @@ resource "azurerm_api_management_api_version_set" "api_pdf_engine_api" {
}

module "apim_api_pdf_engine_api_v1" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//api_management_api?ref=v8.18.0"
source = "./.terraform/modules/__v3__/api_management_api"
count = var.is_feature_enabled.pdf_engine ? 1 : 0

name = "${local.project}-pdf-engine-service-api"
Expand Down Expand Up @@ -100,7 +100,7 @@ resource "azurerm_api_management_api_version_set" "api_pdf_engine_node_api" {
}

module "apim_api_pdf_engine_node_api_v1" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//api_management_api?ref=v8.18.0"
source = "./.terraform/modules/__v3__/api_management_api"
count = var.is_feature_enabled.pdf_engine ? 1 : 0

name = "${var.env_short}-pdf-engine-node-service-api"
Expand Down
2 changes: 1 addition & 1 deletion src/domains/printit-app/05_aks_middleware_tools.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module "tls_checker" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//tls_checker?ref=v8.22.0"
source = "./.terraform/modules/__v3__/tls_checker"

https_endpoint = local.domain_hostname
alert_name = local.domain_hostname
Expand Down
8 changes: 7 additions & 1 deletion src/domains/printit-app/99_main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "<= 3.106.0"
version = "<= 3.116.0"
}
azuread = {
source = "hashicorp/azuread"
Expand Down Expand Up @@ -47,3 +47,9 @@ provider "helm" {
config_path = "${var.k8s_kube_config_path_prefix}/config-${local.aks_name}"
}
}

module "__v3__" {
# v8.59.0
source = "git::https://github.com/pagopa/terraform-azurerm-v3?ref=3fc1dafaf4354e24ca8673005ec0caf4106343a3"
}

7 changes: 7 additions & 0 deletions src/domains/printit-app/99_variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -216,3 +216,10 @@ variable "pod_disruption_budgets" {
description = "Pod disruption budget for domain namespace"
default = {}
}


variable "app_service_ip_restriction_default_action" {
type = string
default = "Allow"
description = "(Optional) The Default action for traffic that does not match any ip_restriction rule. possible values include Allow and Deny. Defaults to Allow."
}
38 changes: 20 additions & 18 deletions src/domains/printit-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,14 @@
## Outputs

No outputs.
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
<!-- BEGIN_TF_DOCS -->
## Requirements

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.6.0 |
| <a name="requirement_azuread"></a> [azuread](#requirement\_azuread) | <= 2.47.0 |
| <a name="requirement_azurerm"></a> [azurerm](#requirement\_azurerm) | <= 3.106.0 |
| <a name="requirement_azurerm"></a> [azurerm](#requirement\_azurerm) | <= 3.116.0 |
| <a name="requirement_helm"></a> [helm](#requirement\_helm) | <= 2.12.1 |
| <a name="requirement_kubernetes"></a> [kubernetes](#requirement\_kubernetes) | <= 2.29.0 |
| <a name="requirement_null"></a> [null](#requirement\_null) | <= 3.2.1 |
Expand All @@ -132,21 +132,22 @@ No outputs.

| Name | Source | Version |
|------|--------|---------|
| <a name="module_apim_api_pdf_engine_api_v1"></a> [apim\_api\_pdf\_engine\_api\_v1](#module\_apim\_api\_pdf\_engine\_api\_v1) | git::https://github.com/pagopa/terraform-azurerm-v3.git//api_management_api | v8.18.0 |
| <a name="module_apim_api_pdf_engine_node_api_v1"></a> [apim\_api\_pdf\_engine\_node\_api\_v1](#module\_apim\_api\_pdf\_engine\_node\_api\_v1) | git::https://github.com/pagopa/terraform-azurerm-v3.git//api_management_api | v8.18.0 |
| <a name="module_apim_notices_blob_api_v1"></a> [apim\_notices\_blob\_api\_v1](#module\_apim\_notices\_blob\_api\_v1) | git::https://github.com/pagopa/terraform-azurerm-v3.git//api_management_api | v8.33.0 |
| <a name="module_apim_notices_blob_product"></a> [apim\_notices\_blob\_product](#module\_apim\_notices\_blob\_product) | git::https://github.com/pagopa/terraform-azurerm-v3.git//api_management_product | v8.33.0 |
| <a name="module_apim_notices_generator_product"></a> [apim\_notices\_generator\_product](#module\_apim\_notices\_generator\_product) | git::https://github.com/pagopa/terraform-azurerm-v3.git//api_management_product | v8.18.0 |
| <a name="module_apim_notices_service_product_external"></a> [apim\_notices\_service\_product\_external](#module\_apim\_notices\_service\_product\_external) | git::https://github.com/pagopa/terraform-azurerm-v3.git//api_management_product | v8.18.0 |
| <a name="module_apim_notices_service_product_internal"></a> [apim\_notices\_service\_product\_internal](#module\_apim\_notices\_service\_product\_internal) | git::https://github.com/pagopa/terraform-azurerm-v3.git//api_management_product | v8.18.0 |
| <a name="module_apim_pdf_engine_product"></a> [apim\_pdf\_engine\_product](#module\_apim\_pdf\_engine\_product) | git::https://github.com/pagopa/terraform-azurerm-v3.git//api_management_product | v8.18.0 |
| <a name="module_kubernetes_service_account"></a> [kubernetes\_service\_account](#module\_kubernetes\_service\_account) | git::https://github.com/pagopa/terraform-azurerm-v3.git//kubernetes_service_account | v8.18.0 |
| <a name="module_pod_identity"></a> [pod\_identity](#module\_pod\_identity) | git::https://github.com/pagopa/terraform-azurerm-v3.git//kubernetes_pod_identity | v8.18.0 |
| <a name="module_printit_pdf_engine_app_service"></a> [printit\_pdf\_engine\_app\_service](#module\_printit\_pdf\_engine\_app\_service) | git::https://github.com/pagopa/terraform-azurerm-v3.git//app_service | v8.18.0 |
| <a name="module_printit_pdf_engine_app_service_java"></a> [printit\_pdf\_engine\_app\_service\_java](#module\_printit\_pdf\_engine\_app\_service\_java) | git::https://github.com/pagopa/terraform-azurerm-v3.git//app_service | v8.18.0 |
| <a name="module_printit_pdf_engine_java_slot_staging"></a> [printit\_pdf\_engine\_java\_slot\_staging](#module\_printit\_pdf\_engine\_java\_slot\_staging) | git::https://github.com/pagopa/terraform-azurerm-v3.git//app_service_slot | v8.18.0 |
| <a name="module_printit_pdf_engine_slot_staging"></a> [printit\_pdf\_engine\_slot\_staging](#module\_printit\_pdf\_engine\_slot\_staging) | git::https://github.com/pagopa/terraform-azurerm-v3.git//app_service_slot | v8.18.0 |
| <a name="module_tls_checker"></a> [tls\_checker](#module\_tls\_checker) | git::https://github.com/pagopa/terraform-azurerm-v3.git//tls_checker | v8.22.0 |
| <a name="module___v3__"></a> [\_\_v3\_\_](#module\_\_\_v3\_\_) | git::https://github.com/pagopa/terraform-azurerm-v3 | 3fc1dafaf4354e24ca8673005ec0caf4106343a3 |
| <a name="module_apim_api_pdf_engine_api_v1"></a> [apim\_api\_pdf\_engine\_api\_v1](#module\_apim\_api\_pdf\_engine\_api\_v1) | ./.terraform/modules/__v3__/api_management_api | n/a |
| <a name="module_apim_api_pdf_engine_node_api_v1"></a> [apim\_api\_pdf\_engine\_node\_api\_v1](#module\_apim\_api\_pdf\_engine\_node\_api\_v1) | ./.terraform/modules/__v3__/api_management_api | n/a |
| <a name="module_apim_notices_blob_api_v1"></a> [apim\_notices\_blob\_api\_v1](#module\_apim\_notices\_blob\_api\_v1) | ./.terraform/modules/__v3__/api_management_api | n/a |
| <a name="module_apim_notices_blob_product"></a> [apim\_notices\_blob\_product](#module\_apim\_notices\_blob\_product) | ./.terraform/modules/__v3__/api_management_product | n/a |
| <a name="module_apim_notices_generator_product"></a> [apim\_notices\_generator\_product](#module\_apim\_notices\_generator\_product) | ./.terraform/modules/__v3__/api_management_product | n/a |
| <a name="module_apim_notices_service_product_external"></a> [apim\_notices\_service\_product\_external](#module\_apim\_notices\_service\_product\_external) | ./.terraform/modules/__v3__/api_management_product | n/a |
| <a name="module_apim_notices_service_product_internal"></a> [apim\_notices\_service\_product\_internal](#module\_apim\_notices\_service\_product\_internal) | ./.terraform/modules/__v3__/api_management_product | n/a |
| <a name="module_apim_pdf_engine_product"></a> [apim\_pdf\_engine\_product](#module\_apim\_pdf\_engine\_product) | ./.terraform/modules/__v3__/api_management_product | n/a |
| <a name="module_kubernetes_service_account"></a> [kubernetes\_service\_account](#module\_kubernetes\_service\_account) | ./.terraform/modules/__v3__/kubernetes_service_account | n/a |
| <a name="module_pod_identity"></a> [pod\_identity](#module\_pod\_identity) | ./.terraform/modules/__v3__/kubernetes_pod_identity | n/a |
| <a name="module_printit_pdf_engine_app_service"></a> [printit\_pdf\_engine\_app\_service](#module\_printit\_pdf\_engine\_app\_service) | ./.terraform/modules/__v3__/app_service | n/a |
| <a name="module_printit_pdf_engine_app_service_java"></a> [printit\_pdf\_engine\_app\_service\_java](#module\_printit\_pdf\_engine\_app\_service\_java) | ./.terraform/modules/__v3__/app_service | n/a |
| <a name="module_printit_pdf_engine_java_slot_staging"></a> [printit\_pdf\_engine\_java\_slot\_staging](#module\_printit\_pdf\_engine\_java\_slot\_staging) | ./.terraform/modules/__v3__/app_service_slot | n/a |
| <a name="module_printit_pdf_engine_slot_staging"></a> [printit\_pdf\_engine\_slot\_staging](#module\_printit\_pdf\_engine\_slot\_staging) | ./.terraform/modules/__v3__/app_service_slot | n/a |
| <a name="module_tls_checker"></a> [tls\_checker](#module\_tls\_checker) | ./.terraform/modules/__v3__/tls_checker | n/a |

## Resources

Expand Down Expand Up @@ -236,6 +237,7 @@ No outputs.
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_apim_dns_zone_prefix"></a> [apim\_dns\_zone\_prefix](#input\_apim\_dns\_zone\_prefix) | The dns subdomain for apim. | `string` | `null` | no |
| <a name="input_app_service_ip_restriction_default_action"></a> [app\_service\_ip\_restriction\_default\_action](#input\_app\_service\_ip\_restriction\_default\_action) | (Optional) The Default action for traffic that does not match any ip\_restriction rule. possible values include Allow and Deny. Defaults to Allow. | `string` | `"Allow"` | no |
| <a name="input_app_service_pdf_engine_always_on"></a> [app\_service\_pdf\_engine\_always\_on](#input\_app\_service\_pdf\_engine\_always\_on) | Always on property | `bool` | n/a | yes |
| <a name="input_app_service_pdf_engine_autoscale_enabled"></a> [app\_service\_pdf\_engine\_autoscale\_enabled](#input\_app\_service\_pdf\_engine\_autoscale\_enabled) | APP Service PDF | `bool` | n/a | yes |
| <a name="input_app_service_pdf_engine_sku_name"></a> [app\_service\_pdf\_engine\_sku\_name](#input\_app\_service\_pdf\_engine\_sku\_name) | app service plan size | `string` | n/a | yes |
Expand Down Expand Up @@ -272,4 +274,4 @@ No outputs.
## Outputs

No outputs.
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
<!-- END_TF_DOCS -->

0 comments on commit 5bc00f9

Please sign in to comment.