Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDT-157: SDT: Upgrade Postgres database to v15 #320

Merged
merged 15 commits into from
Oct 19, 2023
Merged

Conversation

kiran-yenigala-hmcts
Copy link
Collaborator

JIRA link (if applicable)

https://tools.hmcts.net/jira/browse/SDT-157

Change description

Does this PR introduce a breaking change? (check one with "x")

[ ] Yes
[ ] No

@hmcts-jenkins-a-to-c
Copy link
Contributor

Plan Result

Plan: 11 to add, 2 to change, 0 to destroy.
  • Create
    • azurerm_key_vault_secret.POSTGRES-HOST-V15
    • azurerm_key_vault_secret.POSTGRES-PASS-V15
    • azurerm_key_vault_secret.POSTGRES-USER-V15
    • module.postgresql-v15.azurerm_postgresql_flexible_server.pgsql_server
    • module.postgresql-v15.azurerm_postgresql_flexible_server_active_directory_administrator.pgsql_adadmin
    • module.postgresql-v15.azurerm_postgresql_flexible_server_active_directory_administrator.pgsql_principal_admin[0]
    • module.postgresql-v15.azurerm_postgresql_flexible_server_configuration.pgsql_server_config["backslash_quote"]
    • module.postgresql-v15.azurerm_postgresql_flexible_server_database.pg_databases["civil_sdt"]
    • module.postgresql-v15.azurerm_resource_group.rg[0]
    • module.postgresql-v15.null_resource.set-user-permissions-additionaldbs["civil_sdt"]
    • module.postgresql-v15.random_password.password
  • Update
    • module.civil_sdt_key_vault.azurerm_monitor_diagnostic_setting.kv-ds
    • module.postgresql.azurerm_postgresql_flexible_server.pgsql_server
Change Result (Click me)
  # azurerm_key_vault_secret.POSTGRES-HOST-V15 will be created
  + resource "azurerm_key_vault_secret" "POSTGRES-HOST-V15" {
      + id                      = (known after apply)
      + key_vault_id            = "/subscriptions/1c4f0704-a29e-403d-b719-b90c34ef14c9/resourceGroups/civil-sdt-aat/providers/Microsoft.KeyVault/vaults/civil-sdt-aat"
      + name                    = "civil-sdt-POSTGRES-HOST-V15"
      + resource_id             = (known after apply)
      + resource_versionless_id = (known after apply)
      + value                   = (sensitive value)
      + version                 = (known after apply)
      + versionless_id          = (known after apply)
    }

  # azurerm_key_vault_secret.POSTGRES-PASS-V15 will be created
  + resource "azurerm_key_vault_secret" "POSTGRES-PASS-V15" {
      + id                      = (known after apply)
      + key_vault_id            = "/subscriptions/1c4f0704-a29e-403d-b719-b90c34ef14c9/resourceGroups/civil-sdt-aat/providers/Microsoft.KeyVault/vaults/civil-sdt-aat"
      + name                    = "civil-sdt-POSTGRES-PASS-V15"
      + resource_id             = (known after apply)
      + resource_versionless_id = (known after apply)
      + value                   = (sensitive value)
      + version                 = (known after apply)
      + versionless_id          = (known after apply)
    }

  # azurerm_key_vault_secret.POSTGRES-USER-V15 will be created
  + resource "azurerm_key_vault_secret" "POSTGRES-USER-V15" {
      + id                      = (known after apply)
      + key_vault_id            = "/subscriptions/1c4f0704-a29e-403d-b719-b90c34ef14c9/resourceGroups/civil-sdt-aat/providers/Microsoft.KeyVault/vaults/civil-sdt-aat"
      + name                    = "civil-sdt-POSTGRES-USER-V15"
      + resource_id             = (known after apply)
      + resource_versionless_id = (known after apply)
      + value                   = (sensitive value)
      + version                 = (known after apply)
      + versionless_id          = (known after apply)
    }

  # module.civil_sdt_key_vault.azurerm_monitor_diagnostic_setting.kv-ds will be updated in-place
  ~ resource "azurerm_monitor_diagnostic_setting" "kv-ds" {
        id                             = "/subscriptions/1c4f0704-a29e-403d-b719-b90c34ef14c9/resourceGroups/civil-sdt-aat/providers/Microsoft.KeyVault/vaults/civil-sdt-aat|civil-sdt-aat"
        name                           = "civil-sdt-aat"
        # (3 unchanged attributes hidden)

      - metric {
          - category = "AllMetrics" -> null
          - enabled  = false -> null

          - retention_policy {
              - days    = 0 -> null
              - enabled = false -> null
            }
        }

        # (3 unchanged blocks hidden)
    }

  # module.postgresql.azurerm_postgresql_flexible_server.pgsql_server will be updated in-place
  ~ resource "azurerm_postgresql_flexible_server" "pgsql_server" {
      ~ backup_retention_days         = 35 -> 7
        id                            = "/subscriptions/1c4f0704-a29e-403d-b719-b90c34ef14c9/resourceGroups/civil-sdt-data-aat/providers/Microsoft.DBforPostgreSQL/flexibleServers/civil-sdt-aat"
        name                          = "civil-sdt-aat"
        tags                          = {
            "Destroy Me"          = "No"
            "Team Contact"        = "#civil-sdt"
            "application"         = "civil"
            "autoShutdown"        = "true"
            "builtFrom"           = "https://github.com/HMCTS/civil-sdt.git"
            "businessArea"        = "CFT"
            "contactSlackChannel" = "#civil_contact"
            "environment"         = "staging"
            "managedBy"           = "Civil"
        }
        # (15 unchanged attributes hidden)

        # (3 unchanged blocks hidden)
    }

  # module.postgresql-v15.azurerm_postgresql_flexible_server.pgsql_server will be created
  + resource "azurerm_postgresql_flexible_server" "pgsql_server" {
      + administrator_login           = "pgadmin"
      + administrator_password        = (sensitive value)
      + auto_grow_enabled             = false
      + backup_retention_days         = 7
      + create_mode                   = "Default"
      + delegated_subnet_id           = "/subscriptions/96c274ce-846d-4e48-89a7-d528432298a7/resourceGroups/cft-aat-network-rg/providers/Microsoft.Network/virtualNetworks/cft-aat-vnet/subnets/postgresql"
      + fqdn                          = (known after apply)
      + geo_redundant_backup_enabled  = false
      + id                            = (known after apply)
      + location                      = "uksouth"
      + name                          = "civil-sdt-v15-aat"
      + private_dns_zone_id           = "/subscriptions/1baf5470-1c3e-40d3-a6f7-74bfbce4b348/resourceGroups/core-infra-intsvc-rg/providers/Microsoft.Network/privateDnsZones/private.postgres.database.azure.com"
      + public_network_access_enabled = (known after apply)
      + resource_group_name           = "civil-sdt-v15-data-aat"
      + sku_name                      = "GP_Standard_D2s_v3"
      + storage_mb                    = 65536
      + tags                          = {
          + "Destroy Me"          = "No"
          + "Team Contact"        = "#civil-sdt"
          + "application"         = "civil"
          + "autoShutdown"        = "true"
          + "builtFrom"           = "https://github.com/HMCTS/civil-sdt.git"
          + "businessArea"        = "CFT"
          + "contactSlackChannel" = "#civil_contact"
          + "environment"         = "staging"
          + "managedBy"           = "Civil"
        }
      + version                       = "15"

      + authentication {
          + active_directory_auth_enabled = true
          + password_auth_enabled         = true
          + tenant_id                     = "531ff96d-0ae9-462a-8d2d-bec7c0b42082"
        }

      + high_availability {
          + mode = "ZoneRedundant"
        }

      + maintenance_window {
          + day_of_week  = 0
          + start_hour   = 3
          + start_minute = 0
        }
    }

  # module.postgresql-v15.azurerm_postgresql_flexible_server_active_directory_administrator.pgsql_adadmin will be created
  + resource "azurerm_postgresql_flexible_server_active_directory_administrator" "pgsql_adadmin" {
      + id                  = (known after apply)
      + object_id           = "e7ea2042-4ced-45dd-8ae3-e051c6551789"
      + principal_name      = "DTS Platform Operations"
      + principal_type      = "Group"
      + resource_group_name = "civil-sdt-v15-data-aat"
      + server_name         = "civil-sdt-v15-aat"
      + tenant_id           = "531ff96d-0ae9-462a-8d2d-bec7c0b42082"
    }

  # module.postgresql-v15.azurerm_postgresql_flexible_server_active_directory_administrator.pgsql_principal_admin[0] will be created
  + resource "azurerm_postgresql_flexible_server_active_directory_administrator" "pgsql_principal_admin" {
      + id                  = (known after apply)
      + object_id           = "ca6d5085-485a-417d-8480-c3cefa29df31"
      + principal_name      = "jenkins-cftptl-intsvc-mi"
      + principal_type      = "ServicePrincipal"
      + resource_group_name = "civil-sdt-v15-data-aat"
      + server_name         = "civil-sdt-v15-aat"
      + tenant_id           = "531ff96d-0ae9-462a-8d2d-bec7c0b42082"
    }

  # module.postgresql-v15.azurerm_postgresql_flexible_server_configuration.pgsql_server_config["backslash_quote"] will be created
  + resource "azurerm_postgresql_flexible_server_configuration" "pgsql_server_config" {
      + id        = (known after apply)
      + name      = "backslash_quote"
      + server_id = (known after apply)
      + value     = "on"
    }

  # module.postgresql-v15.azurerm_postgresql_flexible_server_database.pg_databases["civil_sdt"] will be created
  + resource "azurerm_postgresql_flexible_server_database" "pg_databases" {
      + charset   = "utf8"
      + collation = "en_GB.utf8"
      + id        = (known after apply)
      + name      = "civil_sdt"
      + server_id = (known after apply)
    }

  # module.postgresql-v15.azurerm_resource_group.rg[0] will be created
  + resource "azurerm_resource_group" "rg" {
      + id       = (known after apply)
      + location = "uksouth"
      + name     = "civil-sdt-v15-data-aat"
      + tags     = {
          + "Destroy Me"          = "No"
          + "Team Contact"        = "#civil-sdt"
          + "application"         = "civil"
          + "autoShutdown"        = "true"
          + "builtFrom"           = "https://github.com/HMCTS/civil-sdt.git"
          + "businessArea"        = "CFT"
          + "contactSlackChannel" = "#civil_contact"
          + "environment"         = "staging"
          + "managedBy"           = "Civil"
        }
    }

  # module.postgresql-v15.null_resource.set-user-permissions-additionaldbs["civil_sdt"] will be created
  + resource "null_resource" "set-user-permissions-additionaldbs" {
      + id       = (known after apply)
      + triggers = {
          + "db_reader_user" = "DTS CFT DB Access Reader"
          + "name"           = "civil-sdt-v15"
          + "script_hash"    = "f1b050abe4f2e8fc188c106259b04ba5034688164070e5ebb3e10137ad569f93"
        }
    }

  # module.postgresql-v15.random_password.password will be created
  + resource "random_password" "password" {
      + bcrypt_hash      = (sensitive value)
      + id               = (known after apply)
      + length           = 20
      + lower            = true
      + min_lower        = 0
      + min_numeric      = 0
      + min_special      = 0
      + min_upper        = 0
      + number           = true
      + numeric          = true
      + override_special = "()-_"
      + result           = (sensitive value)
      + special          = true
      + upper            = true
    }

Plan: 11 to add, 2 to change, 0 to destroy.

Copy link
Collaborator

@paulridout paulridout left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look OK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants