Skip to content

Commit

Permalink
feat: Upgraded apiconfig-app tf provider (#2575)
Browse files Browse the repository at this point in the history
Upgraded apiconfig-app tf provider
  • Loading branch information
mamari90 authored Nov 21, 2024
1 parent 6fbe0ec commit 92c8dad
Show file tree
Hide file tree
Showing 16 changed files with 106 additions and 95 deletions.
74 changes: 37 additions & 37 deletions src/domains/apiconfig-app/.terraform.lock.hcl

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

2 changes: 1 addition & 1 deletion src/domains/apiconfig-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=v4.1.17"
source = "./.terraform/modules/__v3__/kubernetes_pod_identity"

resource_group_name = local.aks_resource_group_name
location = var.location
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ resource "azurerm_api_management_api_version_set" "api_apiconfig_cache_node_nexi

module "apim_api_apiconfig_cache_node_nexi_api_dev_v1" {
count = var.env_short == "d" ? 1 : 0
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//api_management_api?ref=v6.4.1"
source = "./.terraform/modules/__v3__/api_management_api"

name = format("%s-apiconfig-cache-node-%s-api", local.project, "nexi")
api_management_name = local.pagopa_apim_name
Expand Down
5 changes: 3 additions & 2 deletions src/domains/apiconfig-app/04_apim_api_apiconfig-cache-node.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ resource "azurerm_api_management_api_version_set" "api_apiconfig_cache_node_api_
}

module "apim_api_apiconfig_cache_node_api_v1_p" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//api_management_api?ref=v5.1.0"
source = "./.terraform/modules/__v3__/api_management_api"

name = format("%s-apiconfig-cache-node-%s-api", local.project, local.postgres)
api_management_name = local.pagopa_apim_name
resource_group_name = local.pagopa_apim_rg
Expand Down Expand Up @@ -51,7 +52,7 @@ resource "azurerm_api_management_api_version_set" "api_apiconfig_cache_node_api_


module "apim_api_apiconfig_cache_node_api_v1_o" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//api_management_api?ref=v5.1.0"
source = "./.terraform/modules/__v3__/api_management_api"

name = format("%s-apiconfig-cache-node-%s-api", local.project, local.oracle)
api_management_name = local.pagopa_apim_name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ resource "azurerm_api_management_api_version_set" "api_apiconfig_cache_replica_n


module "apim_api_apiconfig_cache_replica_node_api_v1_p" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//api_management_api?ref=v6.4.1"
count = var.env_short == "p" ? 0 : 1
source = "./.terraform/modules/__v3__/api_management_api"

count = var.env_short == "p" ? 0 : 1

name = format("%s-apiconfig-cache-replica-node-%s-api", local.project, "p")
api_management_name = local.pagopa_apim_name
Expand Down Expand Up @@ -48,8 +49,9 @@ module "apim_api_apiconfig_cache_replica_node_api_v1_p" {
}

module "apim_api_apiconfig_cache_replica_node_api_v1_o" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//api_management_api?ref=v6.4.1"
count = var.env_short == "p" ? 0 : 1
source = "./.terraform/modules/__v3__/api_management_api"

count = var.env_short == "p" ? 0 : 1

name = format("%s-apiconfig-cache-replica-node-%s-api", local.project, "o")
api_management_name = local.pagopa_apim_name
Expand Down
8 changes: 4 additions & 4 deletions src/domains/apiconfig-app/04_apim_api_config.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
##############

module "apim_api_config_product" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//api_management_product?ref=v6.4.1"
source = "./.terraform/modules/__v3__/api_management_product"

product_id = "product-api-config"
display_name = "ApiConfig JWT"
Expand Down Expand Up @@ -43,7 +43,7 @@ locals {
}

module "apim_api_config_api" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//api_management_api?ref=v6.4.1"
source = "./.terraform/modules/__v3__/api_management_api"

name = format("%s-api-config-api", var.env_short)
api_management_name = local.pagopa_apim_name
Expand Down Expand Up @@ -115,7 +115,7 @@ resource "azurerm_api_management_authorization_server" "apiconfig-oauth2" {
########################

module "apim_api_config_auth_product" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//api_management_product?ref=v6.4.1"
source = "./.terraform/modules/__v3__/api_management_product"

product_id = "product-api-config-auth"
display_name = "ApiConfig SubKey"
Expand Down Expand Up @@ -157,7 +157,7 @@ resource "azurerm_api_management_api_version_set" "api_config_auth_api" {
}

module "apim_api_config_auth_api" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//api_management_api?ref=v6.4.1"
source = "./.terraform/modules/__v3__/api_management_api"

name = format("%s-api-config-auth-api", var.env_short)
api_management_name = local.pagopa_apim_name
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
###
### IT SHOULD BE DEPRECATED, PLEASE USE cfg-for-node PRODUCT
module "apim_apiconfig_cache_product" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//api_management_product?ref=v6.4.1"
source = "./.terraform/modules/__v3__/api_management_product"

product_id = local.apiconfig_cache_locals.product_id
display_name = local.apiconfig_cache_locals.display_name
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module "apim_apiconfig_selfcare_integration_product" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//api_management_product?ref=v5.1.0"
source = "./.terraform/modules/__v3__/api_management_product"

product_id = local.apiconfig_selfcare_integration_locals.product_id
display_name = local.apiconfig_selfcare_integration_locals.display_name
Expand Down
32 changes: 16 additions & 16 deletions src/domains/apiconfig-app/05_aks_middleware_tools.tf
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
module "tls_checker" {
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//tls_checker?ref=v6.2.1"
source = "./.terraform/modules/__v3__/tls_checker"

https_endpoint = local.apiconfig_core_locals.hostname
alert_name = local.apiconfig_core_locals.hostname
alert_enabled = true
helm_chart_present = true
helm_chart_version = var.tls_cert_check_helm.chart_version
namespace = kubernetes_namespace.namespace.metadata[0].name
helm_chart_image_name = var.tls_cert_check_helm.image_name
helm_chart_image_tag = var.tls_cert_check_helm.image_tag
location_string = var.location_string
application_insights_connection_string = "ai-${var.env_short}-connection-string"
application_insights_resource_group = data.azurerm_resource_group.monitor_rg.name
application_insights_id = data.azurerm_application_insights.application_insights.id
application_insights_action_group_ids = [data.azurerm_monitor_action_group.slack.id, data.azurerm_monitor_action_group.email.id]
keyvault_name = data.azurerm_key_vault.kv.name
keyvault_tenantid = data.azurerm_client_config.current.tenant_id
https_endpoint = local.apiconfig_core_locals.hostname
alert_name = local.apiconfig_core_locals.hostname
alert_enabled = true
helm_chart_present = true
helm_chart_version = var.tls_cert_check_helm.chart_version
namespace = kubernetes_namespace.namespace.metadata[0].name
helm_chart_image_name = var.tls_cert_check_helm.image_name
helm_chart_image_tag = var.tls_cert_check_helm.image_tag
location_string = var.location_string
kv_secret_name_for_application_insights_connection_string = "ai-${var.env_short}-connection-string"
application_insights_resource_group = data.azurerm_resource_group.monitor_rg.name
application_insights_id = data.azurerm_application_insights.application_insights.id
application_insights_action_group_ids = [data.azurerm_monitor_action_group.slack.id, data.azurerm_monitor_action_group.email.id]
keyvault_name = data.azurerm_key_vault.kv.name
keyvault_tenant_id = data.azurerm_client_config.current.tenant_id
}


Expand Down
9 changes: 7 additions & 2 deletions src/domains/apiconfig-app/99_main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ terraform {
}
azurerm = {
source = "hashicorp/azurerm"
version = "<= 3.40.0"
version = "<= 3.116.0"
}
helm = {
source = "hashicorp/helm"
version = "<= 2.5.1"
version = "<= 2.12.1"
}
kubernetes = {
source = "hashicorp/kubernetes"
Expand Down Expand Up @@ -61,3 +61,8 @@ provider "azapi" {
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"
}
Loading

0 comments on commit 92c8dad

Please sign in to comment.