Skip to content

Commit

Permalink
Revert "Revert "[#IOCOM-1202] Added new manage API to IO SERVICES API…
Browse files Browse the repository at this point in the history
…"" (#929)
  • Loading branch information
michaeldisaro authored Mar 27, 2024
1 parent f44b7e1 commit 6fa5bce
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 27 deletions.
85 changes: 60 additions & 25 deletions src/domains/messages-common/05_apim_v2.tf
Original file line number Diff line number Diff line change
Expand Up @@ -68,31 +68,6 @@ module "apim_v2_product_notifications" {
policy_xml = file("./api_product/messages/_base_policy.xml")
}

data "http" "service_messages_openapi" {
url = "https://raw.githubusercontent.com/pagopa/io-functions-service-messages/master/openapi/index.yaml"
}

module "apim_v2_service_messages_api_v1" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3//api_management_api?ref=v7.69.1"

name = format("%s-service-messages-api", local.product)
api_management_name = data.azurerm_api_management.apim_v2_api.name
resource_group_name = data.azurerm_api_management.apim_v2_api.resource_group_name
product_ids = [module.apim_v2_product_notifications.product_id]
subscription_required = true
service_url = null

description = "IO Service - Messages API"
display_name = "IO Service - Messages API"
path = "service-messages/api/v1"
protocols = ["https"]

content_format = "openapi"
content_value = data.http.service_messages_openapi.body

xml_content = file("./api/service-messages/v1/_base_policy.xml")
}

module "io-backend_notification_v2_api_v1" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3//api_management_api?ref=v7.69.1"

Expand Down Expand Up @@ -180,3 +155,63 @@ resource "azurerm_key_vault_secret" "reminder_paymentapi_subscription_primary_ke
content_type = "subscription key"
key_vault_id = module.key_vault.id
}

###############################################
################ API MANAGE ###################
###############################################

data "azurerm_api_management_product" "apim_v2_product_services" {
product_id = "io-services-api"
api_management_name = data.azurerm_api_management.apim_v2_api.name
resource_group_name = data.azurerm_api_management.apim_v2_api.resource_group_name
}

data "http" "service_messages_manage_openapi" {
url = "https://raw.githubusercontent.com/pagopa/io-functions-service-messages/master/openapi/index_external.yaml"
}

module "apim_v2_service_messages_manage_api_v1" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3//api_management_api?ref=v7.69.1"

name = format("%s-service-messages-manage-api", local.product)
api_management_name = data.azurerm_api_management.apim_v2_api.name
resource_group_name = data.azurerm_api_management.apim_v2_api.resource_group_name
product_ids = [data.azurerm_api_management_product.apim_v2_product_services.product_id]
subscription_required = true
service_url = null

description = "IO Service Messages - Manage - API"
display_name = "IO Service Messages - Manage - API"
path = "service-messages/manage/api/v1"
protocols = ["https"]

content_format = "openapi"
content_value = data.http.service_messages_manage_openapi.body

xml_content = file("./api/service-messages/v1/_base_policy.xml")
}

data "http" "service_messages_internal_openapi" {
url = "https://raw.githubusercontent.com/pagopa/io-functions-service-messages/master/openapi/index.yaml"
}

module "apim_v2_service_messages_internal_api_v1" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3//api_management_api?ref=v7.69.1"

name = format("%s-service-messages-internal-api", local.product)
api_management_name = data.azurerm_api_management.apim_v2_api.name
resource_group_name = data.azurerm_api_management.apim_v2_api.resource_group_name
product_ids = [module.apim_v2_product_notifications.product_id]
subscription_required = true
service_url = null

description = "IO Service Messages - Internal - API"
display_name = "IO Service Messages - Internal - API"
path = "service-messages/api/v1"
protocols = ["https"]

content_format = "openapi"
content_value = data.http.service_messages_internal_openapi.body

xml_content = file("./api/service-messages/v1/_base_policy.xml")
}
7 changes: 5 additions & 2 deletions src/domains/messages-common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
| Name | Source | Version |
|------|--------|---------|
| <a name="module_apim_v2_product_notifications"></a> [apim\_v2\_product\_notifications](#module\_apim\_v2\_product\_notifications) | git::https://github.com/pagopa/terraform-azurerm-v3//api_management_product | v7.69.1 |
| <a name="module_apim_v2_service_messages_api_v1"></a> [apim\_v2\_service\_messages\_api\_v1](#module\_apim\_v2\_service\_messages\_api\_v1) | git::https://github.com/pagopa/terraform-azurerm-v3//api_management_api | v7.69.1 |
| <a name="module_apim_v2_service_messages_internal_api_v1"></a> [apim\_v2\_service\_messages\_internal\_api\_v1](#module\_apim\_v2\_service\_messages\_internal\_api\_v1) | git::https://github.com/pagopa/terraform-azurerm-v3//api_management_api | v7.69.1 |
| <a name="module_apim_v2_service_messages_manage_api_v1"></a> [apim\_v2\_service\_messages\_manage\_api\_v1](#module\_apim\_v2\_service\_messages\_manage\_api\_v1) | git::https://github.com/pagopa/terraform-azurerm-v3//api_management_api | v7.69.1 |
| <a name="module_cosmosdb_account_mongodb_reminder"></a> [cosmosdb\_account\_mongodb\_reminder](#module\_cosmosdb\_account\_mongodb\_reminder) | git::https://github.com/pagopa/terraform-azurerm-v3//cosmosdb_account | v7.69.1 |
| <a name="module_cosmosdb_account_remote_content"></a> [cosmosdb\_account\_remote\_content](#module\_cosmosdb\_account\_remote\_content) | git::https://github.com/pagopa/terraform-azurerm-v3//cosmosdb_account | v7.69.1 |
| <a name="module_cosmosdb_sql_database_remote_content"></a> [cosmosdb\_sql\_database\_remote\_content](#module\_cosmosdb\_sql\_database\_remote\_content) | git::https://github.com/pagopa/terraform-azurerm-v3//cosmosdb_sql_database | v7.69.1 |
Expand Down Expand Up @@ -75,6 +76,7 @@
| [azuread_group.adgroup_security](https://registry.terraform.io/providers/hashicorp/azuread/latest/docs/data-sources/group) | data source |
| [azuread_service_principal.platform_iac_sp](https://registry.terraform.io/providers/hashicorp/azuread/latest/docs/data-sources/service_principal) | data source |
| [azurerm_api_management.apim_v2_api](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/api_management) | data source |
| [azurerm_api_management_product.apim_v2_product_services](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/api_management_product) | data source |
| [azurerm_api_management_product.payment_updater_product_v2](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/api_management_product) | data source |
| [azurerm_application_insights.application_insights](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/application_insights) | data source |
| [azurerm_client_config.current](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/client_config) | data source |
Expand All @@ -101,7 +103,8 @@
| [azurerm_subnet.private_endpoints_subnet](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/subnet) | data source |
| [azurerm_subscription.current](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/subscription) | data source |
| [azurerm_virtual_network.vnet_common](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/virtual_network) | data source |
| [http_http.service_messages_openapi](https://registry.terraform.io/providers/hashicorp/http/latest/docs/data-sources/http) | data source |
| [http_http.service_messages_internal_openapi](https://registry.terraform.io/providers/hashicorp/http/latest/docs/data-sources/http) | data source |
| [http_http.service_messages_manage_openapi](https://registry.terraform.io/providers/hashicorp/http/latest/docs/data-sources/http) | data source |

## Inputs

Expand Down

0 comments on commit 6fa5bce

Please sign in to comment.