Skip to content

Commit

Permalink
bug: [PAGOPA-2421] - advisory lock (#2674)
Browse files Browse the repository at this point in the history
* [PAGOPA-2421] advisory lock: new datasource conf for flyway on GPD

* fix

---------

Co-authored-by: Pasquale Spica <[email protected]>
Co-authored-by: pasqualespica <[email protected]>
  • Loading branch information
3 people authored Dec 18, 2024
1 parent a5fd034 commit 73f8772
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/domains/gps-common/02_security.tf
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,17 @@ resource "azurerm_key_vault_secret" "db_url" {
key_vault_id = module.key_vault.id

}

#tfsec:ignore:azure-keyvault-ensure-secret-expiry tfsec:ignore:azure-keyvault-content-type-for-secret
resource "azurerm_key_vault_secret" "flyway_db_url" {
name = "flyway-db-url"
value = format("jdbc:postgresql://%s:%s/%s?sslmode=require%s", local.gpd_hostname, local.flyway_gpd_dbmsport, var.gpd_db_name, "&prepareThreshold=0&lock_timeout=30000")
content_type = "text/plain"

key_vault_id = module.key_vault.id

}

# resource "azurerm_key_vault_secret" "db_url" {
# name = "db-url"
# value = format("jdbc:postgresql://%s:%s/%s?sslmode=require%s", local.gpd_hostname, local.gpd_dbmsport, var.gpd_db_name, (var.env_short != "d" ? "&prepareThreshold=0" : ""))
Expand Down
1 change: 1 addition & 0 deletions src/domains/gps-common/99_locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ locals {
# NEWGPD-DB : DEPRECATED switch to new istance postgres_flexible_server_private_db
gpd_hostname = var.env_short == "p" ? module.postgres_flexible_server_private[0].fqdn : module.postgres_flexible_server_private_db.fqdn
gpd_dbmsport = "6432"
flyway_gpd_dbmsport = "5432"

azdo_managed_identity_rg_name = "pagopa-${var.env_short}-identity-rg"
azdo_iac_managed_identities = toset(["azdo-${var.env}-pagopa-iac-deploy", "azdo-${var.env}-pagopa-iac-plan"])
Expand Down

0 comments on commit 73f8772

Please sign in to comment.