Skip to content

Commit

Permalink
feat: Paymcloud 172 checkout app (#2577)
Browse files Browse the repository at this point in the history
* Upgraded tf provider checkout-app

* precommit

* precommit
  • Loading branch information
mamari90 authored Nov 21, 2024
1 parent f81aab5 commit fc30db6
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 46 deletions.
4 changes: 2 additions & 2 deletions src/domains/checkout-app/.terraform.lock.hcl

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

14 changes: 7 additions & 7 deletions src/domains/checkout-app/04_apim_checkout.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

module "apim_checkout_product" {
count = var.checkout_enabled ? 1 : 0
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//api_management_product?ref=v7.76.1"
source = "./.terraform/modules/__v3__/api_management_product"

product_id = "checkout"
display_name = "checkout pagoPA"
Expand All @@ -23,7 +23,7 @@ module "apim_checkout_product" {

module "apim_checkout_auth_product" {
count = var.checkout_enabled ? 1 : 0
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//api_management_product?ref=v7.76.1"
source = "./.terraform/modules/__v3__/api_management_product"

product_id = "checkout-auth"
display_name = "checkout auth pagoPA"
Expand Down Expand Up @@ -71,7 +71,7 @@ resource "azurerm_api_management_api_version_set" "checkout_payment_activations_
}

module "apim_checkout_payment_activations_api_v1" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//api_management_api?ref=v7.76.1"
source = "./.terraform/modules/__v3__/api_management_api"

name = format("%s-checkout-payment-activations-api", local.parent_project)
api_management_name = data.azurerm_api_management.apim.name
Expand Down Expand Up @@ -125,7 +125,7 @@ resource "azurerm_api_management_api_version_set" "checkout_payment_activations_
}

module "apim_checkout_payment_activations_api_auth_v1" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//api_management_api?ref=v7.76.1"
source = "./.terraform/modules/__v3__/api_management_api"

name = format("%s-checkout-payment-activations-auth-api", local.parent_project)
api_management_name = data.azurerm_api_management.apim.name
Expand All @@ -151,7 +151,7 @@ module "apim_checkout_payment_activations_api_auth_v1" {

# Payment activation v2 authenticated APIs
module "apim_checkout_payment_activations_api_auth_v2" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//api_management_api?ref=v7.76.1"
source = "./.terraform/modules/__v3__/api_management_api"

name = format("%s-checkout-payment-activations-auth-api", local.parent_project)
api_management_name = data.azurerm_api_management.apim.name
Expand Down Expand Up @@ -272,7 +272,7 @@ resource "azurerm_api_management_api_version_set" "checkout_transactions_api" {
module "apim_checkout_transactions_api_v1" {
count = var.checkout_enabled ? 1 : 0

source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//api_management_api?ref=v7.76.1"
source = "./.terraform/modules/__v3__/api_management_api"

name = format("%s-checkout-transactions-api", var.env_short)
api_management_name = data.azurerm_api_management.apim.name
Expand Down Expand Up @@ -319,7 +319,7 @@ resource "azurerm_api_management_api_version_set" "checkout_ecommerce_api_v1" {
}

module "apim_checkout_ecommerce_api_v1" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//api_management_api?ref=v7.76.1"
source = "./.terraform/modules/__v3__/api_management_api"

name = "${local.parent_project}-checkout-ecommerce-api"
api_management_name = data.azurerm_api_management.apim.name
Expand Down
4 changes: 2 additions & 2 deletions src/domains/checkout-app/04_apim_checkout_carts_auth.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
##############

module "apim_checkout_carts_auth" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//api_management_product?ref=v7.76.1"
source = "./.terraform/modules/__v3__/api_management_product"

product_id = "checkout-carts"
display_name = "Checkout pagoPA carts"
Expand Down Expand Up @@ -40,7 +40,7 @@ resource "azurerm_api_management_api_version_set" "checkout_carts_auth_api_v1" {
}

module "apim_checkout_carts_auth_v1" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//api_management_api?ref=v7.76.1"
source = "./.terraform/modules/__v3__/api_management_api"

name = "${local.parent_project}-carts-auth-api"
api_management_name = data.azurerm_api_management.apim.name
Expand Down
4 changes: 2 additions & 2 deletions src/domains/checkout-app/04_apim_checkout_ec.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
##############

module "apim_checkout_ec_product" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//api_management_product?ref=v7.76.1"
source = "./.terraform/modules/__v3__/api_management_product"

product_id = "checkout-ec"
display_name = "checkout pagoPA for ECs"
Expand Down Expand Up @@ -40,7 +40,7 @@ resource "azurerm_api_management_api_version_set" "checkout_ec_api_v1" {
}

module "apim_checkout_ec_api_v1" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//api_management_api?ref=v7.76.1"
source = "./.terraform/modules/__v3__/api_management_api"

name = "${local.parent_project}-checkout-ec-api"
api_management_name = data.azurerm_api_management.apim.name
Expand Down
2 changes: 1 addition & 1 deletion src/domains/checkout-app/05_checkout_fe.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ resource "azurerm_resource_group" "checkout_fe_rg" {
* CDN
*/
module "checkout_cdn" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//cdn?ref=v7.76.1"
source = "./.terraform/modules/__v3__/cdn"

count = var.checkout_enabled ? 1 : 0
name = "checkout"
Expand Down
7 changes: 4 additions & 3 deletions src/domains/checkout-app/05_checkout_function.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ resource "azurerm_resource_group" "checkout_be_rg" {

# Subnet to host checkout function
module "checkout_function_snet" {
count = var.checkout_enabled && var.cidr_subnet_checkout_be != null ? 1 : 0
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//subnet?ref=v7.76.1"
count = var.checkout_enabled && var.cidr_subnet_checkout_be != null ? 1 : 0
source = "./.terraform/modules/__v3__/subnet"

name = format("%s-checkout-be-snet", local.parent_project)
address_prefixes = var.cidr_subnet_checkout_be
resource_group_name = data.azurerm_resource_group.rg_vnet.name
Expand All @@ -33,7 +34,7 @@ module "checkout_function_snet" {

module "checkout_function" {
count = var.checkout_enabled ? 1 : 0
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//function_app?ref=v7.76.1"
source = "./.terraform/modules/__v3__/function_app"

resource_group_name = azurerm_resource_group.checkout_be_rg[0].name
name = format("%s-fn-checkout", local.parent_project)
Expand Down
10 changes: 5 additions & 5 deletions src/domains/checkout-app/05_pagopa_proxy.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ data "azurerm_redis_cache" "pagopa_proxy_redis" {


module "pagopa_proxy_app_service" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//app_service?ref=v7.76.1"
source = "./.terraform/modules/__v3__/app_service"

depends_on = [
module.pagopa_proxy_snet
]

resource_group_name = data.azurerm_resource_group.pagopa_proxy_rg.name
location = var.location
ip_restriction_default_action = "Allow"
resource_group_name = data.azurerm_resource_group.pagopa_proxy_rg.name
location = var.location

# App service plan vars
plan_name = format("%s-plan-pagopa-proxy", local.parent_project)
Expand Down Expand Up @@ -79,7 +79,7 @@ module "pagopa_proxy_app_service" {
module "pagopa_proxy_app_service_slot_staging" {
count = var.env_short == "p" ? 1 : 0

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

# App service plan
# app_service_plan_id = module.pagopa_proxy_app_service.plan_id
Expand Down
5 changes: 3 additions & 2 deletions src/domains/checkout-app/05_pagopa_proxy_ha.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
module "pagopa_proxy_app_service_ha" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//app_service?ref=v7.76.1"
source = "./.terraform/modules/__v3__/app_service"
count = var.pagopa_proxy_ha_enabled ? 1 : 0
depends_on = [
module.pagopa_proxy_snet_ha
]
ip_restriction_default_action = "Allow"

resource_group_name = data.azurerm_resource_group.pagopa_proxy_rg.name
location = var.location
Expand Down Expand Up @@ -39,7 +40,7 @@ module "pagopa_proxy_app_service_ha" {
module "pagopa_proxy_app_service_slot_staging_ha" {
count = var.env_short == "p" && var.pagopa_proxy_ha_enabled ? 1 : 0

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

# App service plan
# app_service_plan_id = module.pagopa_proxy_app_service.plan_id
Expand Down
6 changes: 5 additions & 1 deletion src/domains/checkout-app/99_main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = ">= 3.95.0, <= 3.99.0"
version = "<= 3.116.0"
}
azuread = {
source = "hashicorp/azuread"
Expand All @@ -29,3 +29,7 @@ data "azurerm_subscription" "current" {}

data "azurerm_client_config" "current" {}

module "__v3__" {
# v8.58.0
source = "git::https://github.com/pagopa/terraform-azurerm-v3?ref=63f6181a6f3a51707a2ab4795bdbed2d888c708b"
}
43 changes: 22 additions & 21 deletions src/domains/checkout-app/README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,38 @@
# checkout-app

<!-- markdownlint-disable -->
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
<!-- BEGIN_TF_DOCS -->
## Requirements

| Name | Version |
|------|---------|
| <a name="requirement_azuread"></a> [azuread](#requirement\_azuread) | <= 2.33.0 |
| <a name="requirement_azurerm"></a> [azurerm](#requirement\_azurerm) | >= 3.95.0, <= 3.99.0 |
| <a name="requirement_azurerm"></a> [azurerm](#requirement\_azurerm) | <= 3.116.0 |
| <a name="requirement_null"></a> [null](#requirement\_null) | = 3.2.1 |

## Modules

| Name | Source | Version |
|------|--------|---------|
| <a name="module_apim_checkout_auth_product"></a> [apim\_checkout\_auth\_product](#module\_apim\_checkout\_auth\_product) | git::https://github.com/pagopa/terraform-azurerm-v3.git//api_management_product | v7.76.1 |
| <a name="module_apim_checkout_carts_auth"></a> [apim\_checkout\_carts\_auth](#module\_apim\_checkout\_carts\_auth) | git::https://github.com/pagopa/terraform-azurerm-v3.git//api_management_product | v7.76.1 |
| <a name="module_apim_checkout_carts_auth_v1"></a> [apim\_checkout\_carts\_auth\_v1](#module\_apim\_checkout\_carts\_auth\_v1) | git::https://github.com/pagopa/terraform-azurerm-v3.git//api_management_api | v7.76.1 |
| <a name="module_apim_checkout_ec_api_v1"></a> [apim\_checkout\_ec\_api\_v1](#module\_apim\_checkout\_ec\_api\_v1) | git::https://github.com/pagopa/terraform-azurerm-v3.git//api_management_api | v7.76.1 |
| <a name="module_apim_checkout_ec_product"></a> [apim\_checkout\_ec\_product](#module\_apim\_checkout\_ec\_product) | git::https://github.com/pagopa/terraform-azurerm-v3.git//api_management_product | v7.76.1 |
| <a name="module_apim_checkout_ecommerce_api_v1"></a> [apim\_checkout\_ecommerce\_api\_v1](#module\_apim\_checkout\_ecommerce\_api\_v1) | git::https://github.com/pagopa/terraform-azurerm-v3.git//api_management_api | v7.76.1 |
| <a name="module_apim_checkout_payment_activations_api_auth_v1"></a> [apim\_checkout\_payment\_activations\_api\_auth\_v1](#module\_apim\_checkout\_payment\_activations\_api\_auth\_v1) | git::https://github.com/pagopa/terraform-azurerm-v3.git//api_management_api | v7.76.1 |
| <a name="module_apim_checkout_payment_activations_api_auth_v2"></a> [apim\_checkout\_payment\_activations\_api\_auth\_v2](#module\_apim\_checkout\_payment\_activations\_api\_auth\_v2) | git::https://github.com/pagopa/terraform-azurerm-v3.git//api_management_api | v7.76.1 |
| <a name="module_apim_checkout_payment_activations_api_v1"></a> [apim\_checkout\_payment\_activations\_api\_v1](#module\_apim\_checkout\_payment\_activations\_api\_v1) | git::https://github.com/pagopa/terraform-azurerm-v3.git//api_management_api | v7.76.1 |
| <a name="module_apim_checkout_product"></a> [apim\_checkout\_product](#module\_apim\_checkout\_product) | git::https://github.com/pagopa/terraform-azurerm-v3.git//api_management_product | v7.76.1 |
| <a name="module_apim_checkout_transactions_api_v1"></a> [apim\_checkout\_transactions\_api\_v1](#module\_apim\_checkout\_transactions\_api\_v1) | git::https://github.com/pagopa/terraform-azurerm-v3.git//api_management_api | v7.76.1 |
| <a name="module_checkout_cdn"></a> [checkout\_cdn](#module\_checkout\_cdn) | git::https://github.com/pagopa/terraform-azurerm-v3.git//cdn | v7.76.1 |
| <a name="module_checkout_function"></a> [checkout\_function](#module\_checkout\_function) | git::https://github.com/pagopa/terraform-azurerm-v3.git//function_app | v7.76.1 |
| <a name="module_checkout_function_snet"></a> [checkout\_function\_snet](#module\_checkout\_function\_snet) | git::https://github.com/pagopa/terraform-azurerm-v3.git//subnet | v7.76.1 |
| <a name="module_pagopa_proxy_app_service"></a> [pagopa\_proxy\_app\_service](#module\_pagopa\_proxy\_app\_service) | git::https://github.com/pagopa/terraform-azurerm-v3.git//app_service | v7.76.1 |
| <a name="module_pagopa_proxy_app_service_ha"></a> [pagopa\_proxy\_app\_service\_ha](#module\_pagopa\_proxy\_app\_service\_ha) | git::https://github.com/pagopa/terraform-azurerm-v3.git//app_service | v7.76.1 |
| <a name="module_pagopa_proxy_app_service_slot_staging"></a> [pagopa\_proxy\_app\_service\_slot\_staging](#module\_pagopa\_proxy\_app\_service\_slot\_staging) | git::https://github.com/pagopa/terraform-azurerm-v3.git//app_service_slot | v7.76.1 |
| <a name="module_pagopa_proxy_app_service_slot_staging_ha"></a> [pagopa\_proxy\_app\_service\_slot\_staging\_ha](#module\_pagopa\_proxy\_app\_service\_slot\_staging\_ha) | git::https://github.com/pagopa/terraform-azurerm-v3.git//app_service_slot | v7.76.1 |
| <a name="module___v3__"></a> [\_\_v3\_\_](#module\_\_\_v3\_\_) | git::https://github.com/pagopa/terraform-azurerm-v3 | 63f6181a6f3a51707a2ab4795bdbed2d888c708b |
| <a name="module_apim_checkout_auth_product"></a> [apim\_checkout\_auth\_product](#module\_apim\_checkout\_auth\_product) | ./.terraform/modules/__v3__/api_management_product | n/a |
| <a name="module_apim_checkout_carts_auth"></a> [apim\_checkout\_carts\_auth](#module\_apim\_checkout\_carts\_auth) | ./.terraform/modules/__v3__/api_management_product | n/a |
| <a name="module_apim_checkout_carts_auth_v1"></a> [apim\_checkout\_carts\_auth\_v1](#module\_apim\_checkout\_carts\_auth\_v1) | ./.terraform/modules/__v3__/api_management_api | n/a |
| <a name="module_apim_checkout_ec_api_v1"></a> [apim\_checkout\_ec\_api\_v1](#module\_apim\_checkout\_ec\_api\_v1) | ./.terraform/modules/__v3__/api_management_api | n/a |
| <a name="module_apim_checkout_ec_product"></a> [apim\_checkout\_ec\_product](#module\_apim\_checkout\_ec\_product) | ./.terraform/modules/__v3__/api_management_product | n/a |
| <a name="module_apim_checkout_ecommerce_api_v1"></a> [apim\_checkout\_ecommerce\_api\_v1](#module\_apim\_checkout\_ecommerce\_api\_v1) | ./.terraform/modules/__v3__/api_management_api | n/a |
| <a name="module_apim_checkout_payment_activations_api_auth_v1"></a> [apim\_checkout\_payment\_activations\_api\_auth\_v1](#module\_apim\_checkout\_payment\_activations\_api\_auth\_v1) | ./.terraform/modules/__v3__/api_management_api | n/a |
| <a name="module_apim_checkout_payment_activations_api_auth_v2"></a> [apim\_checkout\_payment\_activations\_api\_auth\_v2](#module\_apim\_checkout\_payment\_activations\_api\_auth\_v2) | ./.terraform/modules/__v3__/api_management_api | n/a |
| <a name="module_apim_checkout_payment_activations_api_v1"></a> [apim\_checkout\_payment\_activations\_api\_v1](#module\_apim\_checkout\_payment\_activations\_api\_v1) | ./.terraform/modules/__v3__/api_management_api | n/a |
| <a name="module_apim_checkout_product"></a> [apim\_checkout\_product](#module\_apim\_checkout\_product) | ./.terraform/modules/__v3__/api_management_product | n/a |
| <a name="module_apim_checkout_transactions_api_v1"></a> [apim\_checkout\_transactions\_api\_v1](#module\_apim\_checkout\_transactions\_api\_v1) | ./.terraform/modules/__v3__/api_management_api | n/a |
| <a name="module_checkout_cdn"></a> [checkout\_cdn](#module\_checkout\_cdn) | ./.terraform/modules/__v3__/cdn | n/a |
| <a name="module_checkout_function"></a> [checkout\_function](#module\_checkout\_function) | ./.terraform/modules/__v3__/function_app | n/a |
| <a name="module_checkout_function_snet"></a> [checkout\_function\_snet](#module\_checkout\_function\_snet) | ./.terraform/modules/__v3__/subnet | n/a |
| <a name="module_pagopa_proxy_app_service"></a> [pagopa\_proxy\_app\_service](#module\_pagopa\_proxy\_app\_service) | ./.terraform/modules/__v3__/app_service | n/a |
| <a name="module_pagopa_proxy_app_service_ha"></a> [pagopa\_proxy\_app\_service\_ha](#module\_pagopa\_proxy\_app\_service\_ha) | ./.terraform/modules/__v3__/app_service | n/a |
| <a name="module_pagopa_proxy_app_service_slot_staging"></a> [pagopa\_proxy\_app\_service\_slot\_staging](#module\_pagopa\_proxy\_app\_service\_slot\_staging) | ./.terraform/modules/__v3__/app_service_slot | n/a |
| <a name="module_pagopa_proxy_app_service_slot_staging_ha"></a> [pagopa\_proxy\_app\_service\_slot\_staging\_ha](#module\_pagopa\_proxy\_app\_service\_slot\_staging\_ha) | ./.terraform/modules/__v3__/app_service_slot | n/a |
| <a name="module_pagopa_proxy_snet"></a> [pagopa\_proxy\_snet](#module\_pagopa\_proxy\_snet) | git::https://github.com/pagopa/terraform-azurerm-v3.git//subnet | v7.76.1 |
| <a name="module_pagopa_proxy_snet_ha"></a> [pagopa\_proxy\_snet\_ha](#module\_pagopa\_proxy\_snet\_ha) | git::https://github.com/pagopa/terraform-azurerm-v3.git//subnet | v7.76.1 |

Expand Down Expand Up @@ -135,4 +136,4 @@
## Outputs

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

0 comments on commit fc30db6

Please sign in to comment.