Skip to content

Commit

Permalink
feat: update cert mounter and tls checker to use wl identity (#2811)
Browse files Browse the repository at this point in the history
* feat(payment-wallet): create workload identity

* feat(payment-wallet): create workload identity

* fix: pre-commit

* feat: update cert mounter and tls checker to use wl identity

---------

Co-authored-by: Simone infante <[email protected]>
  • Loading branch information
pietro-tota and infantesimone authored Feb 20, 2025
1 parent 396f506 commit 804399b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 18 deletions.
30 changes: 13 additions & 17 deletions src/domains/pay-wallet-app/05_aks_middleware_tools.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,21 @@ module "tls_checker" {
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
workload_identity_enabled = true
workload_identity_service_account_name = module.workload_identity.workload_identity_service_account_name
workload_identity_client_id = module.workload_identity.workload_identity_client_id
}

resource "helm_release" "cert_mounter" {
name = "cert-mounter-blueprint"
repository = "https://pagopa.github.io/aks-helm-cert-mounter-blueprint"
chart = "cert-mounter-blueprint"
version = "1.0.4"
namespace = var.domain
timeout = 120
force_update = true

values = [
templatefile("${path.root}/helm/cert-mounter.yaml.tpl", {
NAMESPACE = var.domain,
DOMAIN = var.domain
CERTIFICATE_NAME = replace(local.payment_wallet_hostname, ".", "-"),
ENV_SHORT = var.env_short,
})
]
module "cert_mounter" {
source = "./.terraform/modules/__v3__/cert_mounter"
namespace = var.domain
certificate_name = replace(local.payment_wallet_hostname, ".", "-")
kv_name = data.azurerm_key_vault.kv.name
tenant_id = data.azurerm_subscription.current.tenant_id
workload_identity_enabled = true
workload_identity_service_account_name = module.workload_identity.workload_identity_service_account_name
workload_identity_client_id = module.workload_identity.workload_identity_client_id
depends_on = [module.workload_identity]
}

resource "helm_release" "reloader" {
Expand Down
2 changes: 1 addition & 1 deletion src/domains/pay-wallet-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
| <a name="module_apim_payment_wallet_product"></a> [apim\_payment\_wallet\_product](#module\_apim\_payment\_wallet\_product) | ./.terraform/modules/__v3__/api_management_product | n/a |
| <a name="module_apim_wallet_service_notifications_api_v1"></a> [apim\_wallet\_service\_notifications\_api\_v1](#module\_apim\_wallet\_service\_notifications\_api\_v1) | ./.terraform/modules/__v3__/api_management_api | n/a |
| <a name="module_apim_webview_payment_wallet_api_v1"></a> [apim\_webview\_payment\_wallet\_api\_v1](#module\_apim\_webview\_payment\_wallet\_api\_v1) | ./.terraform/modules/__v3__/api_management_api | n/a |
| <a name="module_cert_mounter"></a> [cert\_mounter](#module\_cert\_mounter) | ./.terraform/modules/__v3__/cert_mounter | 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_tls_checker"></a> [tls\_checker](#module\_tls\_checker) | ./.terraform/modules/__v3__/tls_checker | n/a |
Expand Down Expand Up @@ -61,7 +62,6 @@
| [azurerm_key_vault_secret.aks_apiserver_url](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/key_vault_secret) | resource |
| [azurerm_key_vault_secret.azure_devops_sa_cacrt](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/key_vault_secret) | resource |
| [azurerm_key_vault_secret.azure_devops_sa_token](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/key_vault_secret) | resource |
| [helm_release.cert_mounter](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource |
| [helm_release.reloader](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource |
| [kubernetes_namespace.namespace](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/namespace) | resource |
| [kubernetes_namespace.namespace_system](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/namespace) | resource |
Expand Down

0 comments on commit 804399b

Please sign in to comment.