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

Reinstate infrastructure folder #775

Merged
merged 2 commits into from
Dec 18, 2024

Conversation

muhammad-umerji01
Copy link
Contributor

JIRA link (if applicable)

https://tools.hmcts.net/jira/browse/SIDM-9496

Change description

Components within the infrastructure folder is required in order to run terraform to delete the older DB and secrets.

@hmcts-jenkins-d-to-i
Copy link
Contributor

Plan Result (aat)

⚠️ Resource Deletion will happen

This plan contains resource delete operation. Please check the plan result very carefully!

Plan: 0 to add, 0 to change, 14 to destroy.
  • Delete
    • azurerm_key_vault_secret.POSTGRES-PASS[0]
    • azurerm_key_vault_secret.POSTGRES-USER[0]
    • azurerm_key_vault_secret.POSTGRES_DATABASE[0]
    • azurerm_key_vault_secret.POSTGRES_HOST[0]
    • azurerm_key_vault_secret.POSTGRES_PORT[0]
    • module.idam-testing-support-api-db-v14[0].azurerm_postgresql_flexible_server.pgsql_server
    • module.idam-testing-support-api-db-v14[0].azurerm_postgresql_flexible_server_active_directory_administrator.pgsql_adadmin
    • module.idam-testing-support-api-db-v14[0].azurerm_postgresql_flexible_server_active_directory_administrator.pgsql_principal_admin[0]
    • module.idam-testing-support-api-db-v14[0].azurerm_postgresql_flexible_server_configuration.pgsql_server_config["backslash_quote"]
    • module.idam-testing-support-api-db-v14[0].azurerm_postgresql_flexible_server_database.pg_databases["idamtstsptapi"]
    • module.idam-testing-support-api-db-v14[0].azurerm_resource_group.rg[0]
    • module.idam-testing-support-api-db-v14[0].null_resource.set-user-permissions-additionaldbs["idamtstsptapi"]
    • module.idam-testing-support-api-db-v14[0].random_password.password
    • module.idam-testing-support-api-db-v14[0].terraform_data.trigger_password_reset
Change Result (Click me)
  # azurerm_key_vault_secret.POSTGRES-PASS[0] will be destroyed
  # (because azurerm_key_vault_secret.POSTGRES-PASS is not in configuration)
  - resource "azurerm_key_vault_secret" "POSTGRES-PASS" {
      - id                      = "https://idam-idam-aat.vault.azure.net/secrets/idam-testing-support-api-POSTGRES-PASS/99ab6fb441e3415c8c091dabb819a5cf" -> null
      - key_vault_id            = "/subscriptions/1c4f0704-a29e-403d-b719-b90c34ef14c9/resourceGroups/idam-idam-aat/providers/Microsoft.KeyVault/vaults/idam-idam-aat" -> null
      - name                    = "idam-testing-support-api-POSTGRES-PASS" -> null
      - resource_id             = "/subscriptions/1c4f0704-a29e-403d-b719-b90c34ef14c9/resourceGroups/idam-idam-aat/providers/Microsoft.KeyVault/vaults/idam-idam-aat/secrets/idam-testing-support-api-POSTGRES-PASS/versions/99ab6fb441e3415c8c091dabb819a5cf" -> null
      - resource_versionless_id = "/subscriptions/1c4f0704-a29e-403d-b719-b90c34ef14c9/resourceGroups/idam-idam-aat/providers/Microsoft.KeyVault/vaults/idam-idam-aat/secrets/idam-testing-support-api-POSTGRES-PASS" -> null
      - tags                    = {} -> null
      - value                   = (sensitive value) -> null
      - version                 = "99ab6fb441e3415c8c091dabb819a5cf" -> null
      - versionless_id          = "https://idam-idam-aat.vault.azure.net/secrets/idam-testing-support-api-POSTGRES-PASS" -> null
        # (1 unchanged attribute hidden)
    }

  # azurerm_key_vault_secret.POSTGRES-USER[0] will be destroyed
  # (because azurerm_key_vault_secret.POSTGRES-USER is not in configuration)
  - resource "azurerm_key_vault_secret" "POSTGRES-USER" {
      - id                      = "https://idam-idam-aat.vault.azure.net/secrets/idam-testing-support-api-POSTGRES-USER/52ad849b3fa84c51b3cee4d548c87252" -> null
      - key_vault_id            = "/subscriptions/1c4f0704-a29e-403d-b719-b90c34ef14c9/resourceGroups/idam-idam-aat/providers/Microsoft.KeyVault/vaults/idam-idam-aat" -> null
      - name                    = "idam-testing-support-api-POSTGRES-USER" -> null
      - resource_id             = "/subscriptions/1c4f0704-a29e-403d-b719-b90c34ef14c9/resourceGroups/idam-idam-aat/providers/Microsoft.KeyVault/vaults/idam-idam-aat/secrets/idam-testing-support-api-POSTGRES-USER/versions/52ad849b3fa84c51b3cee4d548c87252" -> null
      - resource_versionless_id = "/subscriptions/1c4f0704-a29e-403d-b719-b90c34ef14c9/resourceGroups/idam-idam-aat/providers/Microsoft.KeyVault/vaults/idam-idam-aat/secrets/idam-testing-support-api-POSTGRES-USER" -> null
      - tags                    = {} -> null
      - value                   = (sensitive value) -> null
      - version                 = "52ad849b3fa84c51b3cee4d548c87252" -> null
      - versionless_id          = "https://idam-idam-aat.vault.azure.net/secrets/idam-testing-support-api-POSTGRES-USER" -> null
        # (1 unchanged attribute hidden)
    }

  # azurerm_key_vault_secret.POSTGRES_DATABASE[0] will be destroyed
  # (because azurerm_key_vault_secret.POSTGRES_DATABASE is not in configuration)
  - resource "azurerm_key_vault_secret" "POSTGRES_DATABASE" {
      - id                      = "https://idam-idam-aat.vault.azure.net/secrets/idam-testing-support-api-POSTGRES-DATABASE/f4634ff7d6284777b102aa6d8bf1136d" -> null
      - key_vault_id            = "/subscriptions/1c4f0704-a29e-403d-b719-b90c34ef14c9/resourceGroups/idam-idam-aat/providers/Microsoft.KeyVault/vaults/idam-idam-aat" -> null
      - name                    = "idam-testing-support-api-POSTGRES-DATABASE" -> null
      - resource_id             = "/subscriptions/1c4f0704-a29e-403d-b719-b90c34ef14c9/resourceGroups/idam-idam-aat/providers/Microsoft.KeyVault/vaults/idam-idam-aat/secrets/idam-testing-support-api-POSTGRES-DATABASE/versions/f4634ff7d6284777b102aa6d8bf1136d" -> null
      - resource_versionless_id = "/subscriptions/1c4f0704-a29e-403d-b719-b90c34ef14c9/resourceGroups/idam-idam-aat/providers/Microsoft.KeyVault/vaults/idam-idam-aat/secrets/idam-testing-support-api-POSTGRES-DATABASE" -> null
      - tags                    = {} -> null
      - value                   = (sensitive value) -> null
      - version                 = "f4634ff7d6284777b102aa6d8bf1136d" -> null
      - versionless_id          = "https://idam-idam-aat.vault.azure.net/secrets/idam-testing-support-api-POSTGRES-DATABASE" -> null
        # (1 unchanged attribute hidden)
    }

  # azurerm_key_vault_secret.POSTGRES_HOST[0] will be destroyed
  # (because azurerm_key_vault_secret.POSTGRES_HOST is not in configuration)
  - resource "azurerm_key_vault_secret" "POSTGRES_HOST" {
      - id                      = "https://idam-idam-aat.vault.azure.net/secrets/idam-testing-support-api-POSTGRES-HOST/95b069a3715e47df84b69c832a441c77" -> null
      - key_vault_id            = "/subscriptions/1c4f0704-a29e-403d-b719-b90c34ef14c9/resourceGroups/idam-idam-aat/providers/Microsoft.KeyVault/vaults/idam-idam-aat" -> null
      - name                    = "idam-testing-support-api-POSTGRES-HOST" -> null
      - resource_id             = "/subscriptions/1c4f0704-a29e-403d-b719-b90c34ef14c9/resourceGroups/idam-idam-aat/providers/Microsoft.KeyVault/vaults/idam-idam-aat/secrets/idam-testing-support-api-POSTGRES-HOST/versions/95b069a3715e47df84b69c832a441c77" -> null
      - resource_versionless_id = "/subscriptions/1c4f0704-a29e-403d-b719-b90c34ef14c9/resourceGroups/idam-idam-aat/providers/Microsoft.KeyVault/vaults/idam-idam-aat/secrets/idam-testing-support-api-POSTGRES-HOST" -> null
      - tags                    = {} -> null
      - value                   = (sensitive value) -> null
      - version                 = "95b069a3715e47df84b69c832a441c77" -> null
      - versionless_id          = "https://idam-idam-aat.vault.azure.net/secrets/idam-testing-support-api-POSTGRES-HOST" -> null
        # (1 unchanged attribute hidden)
    }

  # azurerm_key_vault_secret.POSTGRES_PORT[0] will be destroyed
  # (because azurerm_key_vault_secret.POSTGRES_PORT is not in configuration)
  - resource "azurerm_key_vault_secret" "POSTGRES_PORT" {
      - id                      = "https://idam-idam-aat.vault.azure.net/secrets/idam-testing-support-api-POSTGRES-PORT/266265045aa74915872937de85c46059" -> null
      - key_vault_id            = "/subscriptions/1c4f0704-a29e-403d-b719-b90c34ef14c9/resourceGroups/idam-idam-aat/providers/Microsoft.KeyVault/vaults/idam-idam-aat" -> null
      - name                    = "idam-testing-support-api-POSTGRES-PORT" -> null
      - resource_id             = "/subscriptions/1c4f0704-a29e-403d-b719-b90c34ef14c9/resourceGroups/idam-idam-aat/providers/Microsoft.KeyVault/vaults/idam-idam-aat/secrets/idam-testing-support-api-POSTGRES-PORT/versions/266265045aa74915872937de85c46059" -> null
      - resource_versionless_id = "/subscriptions/1c4f0704-a29e-403d-b719-b90c34ef14c9/resourceGroups/idam-idam-aat/providers/Microsoft.KeyVault/vaults/idam-idam-aat/secrets/idam-testing-support-api-POSTGRES-PORT" -> null
      - tags                    = {} -> null
      - value                   = (sensitive value) -> null
      - version                 = "266265045aa74915872937de85c46059" -> null
      - versionless_id          = "https://idam-idam-aat.vault.azure.net/secrets/idam-testing-support-api-POSTGRES-PORT" -> null
        # (1 unchanged attribute hidden)
    }

  # module.idam-testing-support-api-db-v14[0].azurerm_postgresql_flexible_server.pgsql_server will be destroyed
  # (because azurerm_postgresql_flexible_server.pgsql_server is not in configuration)
  - resource "azurerm_postgresql_flexible_server" "pgsql_server" {
      - administrator_login           = "pgadmin" -> null
      - administrator_password        = (sensitive value) -> null
      - auto_grow_enabled             = false -> null
      - backup_retention_days         = 35 -> null
      - create_mode                   = "Default" -> null
      - delegated_subnet_id           = "/subscriptions/96c274ce-846d-4e48-89a7-d528432298a7/resourceGroups/cft-aat-network-rg/providers/Microsoft.Network/virtualNetworks/cft-aat-vnet/subnets/postgres-expanded" -> null
      - fqdn                          = "idam-testing-support-api-v14-aat.postgres.database.azure.com" -> null
      - geo_redundant_backup_enabled  = false -> null
      - id                            = "/subscriptions/1c4f0704-a29e-403d-b719-b90c34ef14c9/resourceGroups/idam-testing-support-api-v14-data-aat/providers/Microsoft.DBforPostgreSQL/flexibleServers/idam-testing-support-api-v14-aat" -> null
      - location                      = "uksouth" -> null
      - name                          = "idam-testing-support-api-v14-aat" -> null
      - private_dns_zone_id           = "/subscriptions/1baf5470-1c3e-40d3-a6f7-74bfbce4b348/resourceGroups/core-infra-intsvc-rg/providers/Microsoft.Network/privateDnsZones/private.postgres.database.azure.com" -> null
      - public_network_access_enabled = false -> null
      - resource_group_name           = "idam-testing-support-api-v14-data-aat" -> null
      - sku_name                      = "GP_Standard_D2s_v3" -> null
      - storage_mb                    = 65536 -> null
      - storage_tier                  = "P6" -> null
      - tags                          = {
          - "application"         = "cft-idam"
          - "autoShutdown"        = "true"
          - "builtFrom"           = "https://github.com/HMCTS/idam-testing-support-api.git"
          - "businessArea"        = "CFT"
          - "contactSlackChannel" = "#idam-support-cft"
          - "environment"         = "staging"
          - "managedBy"           = "IdAM"
        } -> null
      - version                       = "14" -> null
      - zone                          = "1" -> null
        # (1 unchanged attribute hidden)

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

      - high_availability {
          - mode                      = "ZoneRedundant" -> null
          - standby_availability_zone = "3" -> null
        }

      - maintenance_window {
          - day_of_week  = 0 -> null
          - start_hour   = 3 -> null
          - start_minute = 0 -> null
        }
    }

  # module.idam-testing-support-api-db-v14[0].azurerm_postgresql_flexible_server_active_directory_administrator.pgsql_adadmin will be destroyed
  # (because azurerm_postgresql_flexible_server_active_directory_administrator.pgsql_adadmin is not in configuration)
  - resource "azurerm_postgresql_flexible_server_active_directory_administrator" "pgsql_adadmin" {
      - id                  = "/subscriptions/1c4f0704-a29e-403d-b719-b90c34ef14c9/resourceGroups/idam-testing-support-api-v14-data-aat/providers/Microsoft.DBforPostgreSQL/flexibleServers/idam-testing-support-api-v14-aat/administrators/e7ea2042-4ced-45dd-8ae3-e051c6551789" -> null
      - object_id           = "e7ea2042-4ced-45dd-8ae3-e051c6551789" -> null
      - principal_name      = "DTS Platform Operations" -> null
      - principal_type      = "Group" -> null
      - resource_group_name = "idam-testing-support-api-v14-data-aat" -> null
      - server_name         = "idam-testing-support-api-v14-aat" -> null
      - tenant_id           = "531ff96d-0ae9-462a-8d2d-bec7c0b42082" -> null
    }

  # module.idam-testing-support-api-db-v14[0].azurerm_postgresql_flexible_server_active_directory_administrator.pgsql_principal_admin[0] will be destroyed
  # (because azurerm_postgresql_flexible_server_active_directory_administrator.pgsql_principal_admin is not in configuration)
  - resource "azurerm_postgresql_flexible_server_active_directory_administrator" "pgsql_principal_admin" {
      - id                  = "/subscriptions/1c4f0704-a29e-403d-b719-b90c34ef14c9/resourceGroups/idam-testing-support-api-v14-data-aat/providers/Microsoft.DBforPostgreSQL/flexibleServers/idam-testing-support-api-v14-aat/administrators/ca6d5085-485a-417d-8480-c3cefa29df31" -> null
      - object_id           = "ca6d5085-485a-417d-8480-c3cefa29df31" -> null
      - principal_name      = "jenkins-cftptl-intsvc-mi" -> null
      - principal_type      = "ServicePrincipal" -> null
      - resource_group_name = "idam-testing-support-api-v14-data-aat" -> null
      - server_name         = "idam-testing-support-api-v14-aat" -> null
      - tenant_id           = "531ff96d-0ae9-462a-8d2d-bec7c0b42082" -> null
    }

  # module.idam-testing-support-api-db-v14[0].azurerm_postgresql_flexible_server_configuration.pgsql_server_config["backslash_quote"] will be destroyed
  # (because azurerm_postgresql_flexible_server_configuration.pgsql_server_config is not in configuration)
  - resource "azurerm_postgresql_flexible_server_configuration" "pgsql_server_config" {
      - id        = "/subscriptions/1c4f0704-a29e-403d-b719-b90c34ef14c9/resourceGroups/idam-testing-support-api-v14-data-aat/providers/Microsoft.DBforPostgreSQL/flexibleServers/idam-testing-support-api-v14-aat/configurations/backslash_quote" -> null
      - name      = "backslash_quote" -> null
      - server_id = "/subscriptions/1c4f0704-a29e-403d-b719-b90c34ef14c9/resourceGroups/idam-testing-support-api-v14-data-aat/providers/Microsoft.DBforPostgreSQL/flexibleServers/idam-testing-support-api-v14-aat" -> null
      - value     = "on" -> null
    }

  # module.idam-testing-support-api-db-v14[0].azurerm_postgresql_flexible_server_database.pg_databases["idamtstsptapi"] will be destroyed
  # (because azurerm_postgresql_flexible_server_database.pg_databases is not in configuration)
  - resource "azurerm_postgresql_flexible_server_database" "pg_databases" {
      - charset   = "UTF8" -> null
      - collation = "en_GB.utf8" -> null
      - id        = "/subscriptions/1c4f0704-a29e-403d-b719-b90c34ef14c9/resourceGroups/idam-testing-support-api-v14-data-aat/providers/Microsoft.DBforPostgreSQL/flexibleServers/idam-testing-support-api-v14-aat/databases/idamtstsptapi" -> null
      - name      = "idamtstsptapi" -> null
      - server_id = "/subscriptions/1c4f0704-a29e-403d-b719-b90c34ef14c9/resourceGroups/idam-testing-support-api-v14-data-aat/providers/Microsoft.DBforPostgreSQL/flexibleServers/idam-testing-support-api-v14-aat" -> null
    }

  # module.idam-testing-support-api-db-v14[0].azurerm_resource_group.rg[0] will be destroyed
  # (because azurerm_resource_group.rg is not in configuration)
  - resource "azurerm_resource_group" "rg" {
      - id         = "/subscriptions/1c4f0704-a29e-403d-b719-b90c34ef14c9/resourceGroups/idam-testing-support-api-v14-data-aat" -> null
      - location   = "uksouth" -> null
      - name       = "idam-testing-support-api-v14-data-aat" -> null
      - tags       = {
          - "application"         = "cft-idam"
          - "autoShutdown"        = "true"
          - "builtFrom"           = "https://github.com/HMCTS/idam-testing-support-api.git"
          - "businessArea"        = "CFT"
          - "contactSlackChannel" = "#idam-support-cft"
          - "environment"         = "staging"
          - "managedBy"           = "IdAM"
        } -> null
        # (1 unchanged attribute hidden)
    }

  # module.idam-testing-support-api-db-v14[0].null_resource.set-user-permissions-additionaldbs["idamtstsptapi"] will be destroyed
  # (because null_resource.set-user-permissions-additionaldbs is not in configuration)
  - resource "null_resource" "set-user-permissions-additionaldbs" {
      - id       = "591670850815695030" -> null
      - triggers = {
          - "db_reader_user" = "DTS CFT DB Access Reader"
          - "force_trigger"  = null
          - "name"           = "idam-testing-support-api-v14"
          - "script_hash"    = "dbe0102f3129d4463913d5e01177e806bc6954005bdd98f20c242658634a1bbc"
        } -> null
    }

  # module.idam-testing-support-api-db-v14[0].random_password.password will be destroyed
  # (because random_password.password is not in configuration)
  - resource "random_password" "password" {
      - bcrypt_hash      = (sensitive value) -> null
      - id               = "none" -> null
      - length           = 20 -> null
      - lower            = true -> null
      - min_lower        = 0 -> null
      - min_numeric      = 0 -> null
      - min_special      = 0 -> null
      - min_upper        = 0 -> null
      - number           = true -> null
      - numeric          = true -> null
      - override_special = "()-_" -> null
      - result           = (sensitive value) -> null
      - special          = true -> null
      - upper            = true -> null
    }

  # module.idam-testing-support-api-db-v14[0].terraform_data.trigger_password_reset will be destroyed
  # (because terraform_data.trigger_password_reset is not in configuration)
  - resource "terraform_data" "trigger_password_reset" {
      - id     = "11b6e67c-b5e6-9a43-60f3-883ccd2ea350" -> null
      - input  = "" -> null
      - output = "" -> null
    }

Plan: 0 to add, 0 to change, 14 to destroy.

@muhammad-umerji01 muhammad-umerji01 merged commit 6c1d90e into master Dec 18, 2024
5 checks passed
@muhammad-umerji01 muhammad-umerji01 deleted the SIDM-8130-reinstate-infra-folder branch December 18, 2024 17:22
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