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

Cme 124 db testing #845

Open
wants to merge 6 commits into
base: ithc
Choose a base branch
from
Open

Cme 124 db testing #845

wants to merge 6 commits into from

Conversation

AntonyLeons
Copy link

Before creating a pull request make sure that:

  • commit messages are meaningful and follow good commit message guidelines
  • README and other documentation has been updated / added (if needed)
  • tests have been updated / new tests has been added (if needed)

Please remove this line and everything above and fill the following sections:

JIRA link (if applicable)

https://tools.hmcts.net/jira/browse/CME-124

Change description

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

[ ] Yes
[ ] No

@hmcts-jenkins-j-to-z
Copy link
Contributor

Plan Result (aat)

Plan: 4 to add, 2 to change, 0 to destroy.
  • Create
    • module.wa_workflow_api_database_flex.azurerm_monitor_action_group.db-alerts-action-group[0]
    • module.wa_workflow_api_database_flex.azurerm_monitor_metric_alert.db_alert_cpu[0]
    • module.wa_workflow_api_database_flex.azurerm_monitor_metric_alert.db_alert_memory[0]
    • module.wa_workflow_api_database_flex.azurerm_monitor_metric_alert.db_alert_storage_utilization[0]
  • Update
    • module.wa_workflow_api_database_flex.azurerm_postgresql_flexible_server.pgsql_server
    • module.wa_workflow_api_database_flex.azurerm_resource_group.rg[0]
Change Result (Click me)
  # module.wa_workflow_api_database_flex.azurerm_monitor_action_group.db-alerts-action-group[0] will be created
  + resource "azurerm_monitor_action_group" "db-alerts-action-group" {
      + enabled             = true
      + id                  = (known after apply)
      + location            = "global"
      + name                = "wa-workflow-api-postgres-db-flex-wa-support"
      + resource_group_name = "wa-workflow-api-postgres-db-flex-data-aat"
      + short_name          = "wa-workflow-"
      + tags                = (known after apply)

      + email_receiver {
          + email_address           = (sensitive value)
          + name                    = "Email Receiver"
          + use_common_alert_schema = true
        }
    }

  # module.wa_workflow_api_database_flex.azurerm_monitor_metric_alert.db_alert_cpu[0] will be created
  + resource "azurerm_monitor_metric_alert" "db_alert_cpu" {
      + auto_mitigate            = true
      + description              = "Whenever the cpu utilization is greater than 80%"
      + enabled                  = true
      + frequency                = "PT5M"
      + id                       = (known after apply)
      + name                     = "db_cpu_percent_wa-workflow-api-postgres-db-flex-aat"
      + resource_group_name      = "wa-workflow-api-postgres-db-flex-data-aat"
      + scopes                   = [
          + "/subscriptions/1c4f0704-a29e-403d-b719-b90c34ef14c9/resourceGroups/wa-workflow-api-postgres-db-flex-data-aat/providers/Microsoft.DBforPostgreSQL/flexibleServers/wa-workflow-api-postgres-db-flex-aat",
        ]
      + severity                 = 1
      + tags                     = (known after apply)
      + target_resource_location = (known after apply)
      + target_resource_type     = (known after apply)
      + window_size              = "PT15M"

      + action {
          + action_group_id = (known after apply)
        }

      + criteria {
          + aggregation            = "Average"
          + metric_name            = "cpu_percent"
          + metric_namespace       = "Microsoft.DBforPostgreSQL/flexibleServers"
          + operator               = "GreaterThanOrEqual"
          + skip_metric_validation = false
          + threshold              = 80
        }
    }

  # module.wa_workflow_api_database_flex.azurerm_monitor_metric_alert.db_alert_memory[0] will be created
  + resource "azurerm_monitor_metric_alert" "db_alert_memory" {
      + auto_mitigate            = true
      + description              = "Whenever the memory utilization is greater than 80%"
      + enabled                  = true
      + frequency                = "PT5M"
      + id                       = (known after apply)
      + name                     = "db_memory_percent_wa-workflow-api-postgres-db-flex-aat"
      + resource_group_name      = "wa-workflow-api-postgres-db-flex-data-aat"
      + scopes                   = [
          + "/subscriptions/1c4f0704-a29e-403d-b719-b90c34ef14c9/resourceGroups/wa-workflow-api-postgres-db-flex-data-aat/providers/Microsoft.DBforPostgreSQL/flexibleServers/wa-workflow-api-postgres-db-flex-aat",
        ]
      + severity                 = 1
      + tags                     = (known after apply)
      + target_resource_location = (known after apply)
      + target_resource_type     = (known after apply)
      + window_size              = "PT15M"

      + action {
          + action_group_id = (known after apply)
        }

      + criteria {
          + aggregation            = "Average"
          + metric_name            = "memory_percent"
          + metric_namespace       = "Microsoft.DBforPostgreSQL/flexibleServers"
          + operator               = "GreaterThanOrEqual"
          + skip_metric_validation = false
          + threshold              = 80
        }
    }

  # module.wa_workflow_api_database_flex.azurerm_monitor_metric_alert.db_alert_storage_utilization[0] will be created
  + resource "azurerm_monitor_metric_alert" "db_alert_storage_utilization" {
      + auto_mitigate            = true
      + description              = "Whenever the storage utilization is greater than 80%"
      + enabled                  = true
      + frequency                = "PT5M"
      + id                       = (known after apply)
      + name                     = "db_storage_utilization_wa-workflow-api-postgres-db-flex-aat"
      + resource_group_name      = "wa-workflow-api-postgres-db-flex-data-aat"
      + scopes                   = [
          + "/subscriptions/1c4f0704-a29e-403d-b719-b90c34ef14c9/resourceGroups/wa-workflow-api-postgres-db-flex-data-aat/providers/Microsoft.DBforPostgreSQL/flexibleServers/wa-workflow-api-postgres-db-flex-aat",
        ]
      + severity                 = 1
      + tags                     = (known after apply)
      + target_resource_location = (known after apply)
      + target_resource_type     = (known after apply)
      + window_size              = "PT15M"

      + action {
          + action_group_id = (known after apply)
        }

      + criteria {
          + aggregation            = "Average"
          + metric_name            = "storage_percent"
          + metric_namespace       = "Microsoft.DBforPostgreSQL/flexibleServers"
          + operator               = "GreaterThanOrEqual"
          + skip_metric_validation = false
          + threshold              = 80
        }
    }

  # module.wa_workflow_api_database_flex.azurerm_postgresql_flexible_server.pgsql_server will be updated in-place
  ~ resource "azurerm_postgresql_flexible_server" "pgsql_server" {
        id                            = "/subscriptions/1c4f0704-a29e-403d-b719-b90c34ef14c9/resourceGroups/wa-workflow-api-postgres-db-flex-data-aat/providers/Microsoft.DBforPostgreSQL/flexibleServers/wa-workflow-api-postgres-db-flex-aat"
        name                          = "wa-workflow-api-postgres-db-flex-aat"
      ~ tags                          = {
          - "application"         = "task-management"
          - "autoShutdown"        = "true"
          - "builtFrom"           = "https://github.com/HMCTS/wa-workflow-api.git"
          - "businessArea"        = "CFT"
          - "contactSlackChannel" = "#wa-tech"
          - "environment"         = "staging"
          - "lastUpdated"         = "2024-12-19T15:14:47Z"
          - "managedBy"           = "Work Allocation"
        } -> (known after apply)
        # (18 unchanged attributes hidden)

        # (3 unchanged blocks hidden)
    }

  # module.wa_workflow_api_database_flex.azurerm_resource_group.rg[0] will be updated in-place
  ~ resource "azurerm_resource_group" "rg" {
        id         = "/subscriptions/1c4f0704-a29e-403d-b719-b90c34ef14c9/resourceGroups/wa-workflow-api-postgres-db-flex-data-aat"
        name       = "wa-workflow-api-postgres-db-flex-data-aat"
      ~ tags       = {
          - "application"         = "task-management"
          - "autoShutdown"        = "true"
          - "builtFrom"           = "https://github.com/HMCTS/wa-workflow-api.git"
          - "businessArea"        = "CFT"
          - "contactSlackChannel" = "#wa-tech"
          - "environment"         = "staging"
          - "lastUpdated"         = "2024-12-19T15:14:47Z"
          - "managedBy"           = "Work Allocation"
        } -> (known after apply)
        # (2 unchanged attributes hidden)
    }

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

@hmcts-jenkins-j-to-z
Copy link
Contributor

Plan Result (ithc)

Plan: 4 to add, 2 to change, 0 to destroy.
  • Create
    • module.wa_workflow_api_database_flex.azurerm_monitor_action_group.db-alerts-action-group[0]
    • module.wa_workflow_api_database_flex.azurerm_monitor_metric_alert.db_alert_cpu[0]
    • module.wa_workflow_api_database_flex.azurerm_monitor_metric_alert.db_alert_memory[0]
    • module.wa_workflow_api_database_flex.azurerm_monitor_metric_alert.db_alert_storage_utilization[0]
  • Update
    • module.wa_workflow_api_database_flex.azurerm_postgresql_flexible_server.pgsql_server
    • module.wa_workflow_api_database_flex.azurerm_resource_group.rg[0]
Change Result (Click me)
  # module.wa_workflow_api_database_flex.azurerm_monitor_action_group.db-alerts-action-group[0] will be created
  + resource "azurerm_monitor_action_group" "db-alerts-action-group" {
      + enabled             = true
      + id                  = (known after apply)
      + location            = "global"
      + name                = "wa-workflow-api-postgres-db-flex-wa-support"
      + resource_group_name = "wa-workflow-api-postgres-db-flex-data-ithc"
      + short_name          = "wa-workflow-"
      + tags                = (known after apply)

      + email_receiver {
          + email_address           = (sensitive value)
          + name                    = "Email Receiver"
          + use_common_alert_schema = true
        }
    }

  # module.wa_workflow_api_database_flex.azurerm_monitor_metric_alert.db_alert_cpu[0] will be created
  + resource "azurerm_monitor_metric_alert" "db_alert_cpu" {
      + auto_mitigate            = true
      + description              = "Whenever the cpu utilization is greater than 80%"
      + enabled                  = true
      + frequency                = "PT5M"
      + id                       = (known after apply)
      + name                     = "db_cpu_percent_wa-workflow-api-postgres-db-flex-ithc"
      + resource_group_name      = "wa-workflow-api-postgres-db-flex-data-ithc"
      + scopes                   = [
          + "/subscriptions/7a4e3bd5-ae3a-4d0c-b441-2188fee3ff1c/resourceGroups/wa-workflow-api-postgres-db-flex-data-ithc/providers/Microsoft.DBforPostgreSQL/flexibleServers/wa-workflow-api-postgres-db-flex-ithc",
        ]
      + severity                 = 1
      + tags                     = (known after apply)
      + target_resource_location = (known after apply)
      + target_resource_type     = (known after apply)
      + window_size              = "PT15M"

      + action {
          + action_group_id = (known after apply)
        }

      + criteria {
          + aggregation            = "Average"
          + metric_name            = "cpu_percent"
          + metric_namespace       = "Microsoft.DBforPostgreSQL/flexibleServers"
          + operator               = "GreaterThanOrEqual"
          + skip_metric_validation = false
          + threshold              = 80
        }
    }

  # module.wa_workflow_api_database_flex.azurerm_monitor_metric_alert.db_alert_memory[0] will be created
  + resource "azurerm_monitor_metric_alert" "db_alert_memory" {
      + auto_mitigate            = true
      + description              = "Whenever the memory utilization is greater than 80%"
      + enabled                  = true
      + frequency                = "PT5M"
      + id                       = (known after apply)
      + name                     = "db_memory_percent_wa-workflow-api-postgres-db-flex-ithc"
      + resource_group_name      = "wa-workflow-api-postgres-db-flex-data-ithc"
      + scopes                   = [
          + "/subscriptions/7a4e3bd5-ae3a-4d0c-b441-2188fee3ff1c/resourceGroups/wa-workflow-api-postgres-db-flex-data-ithc/providers/Microsoft.DBforPostgreSQL/flexibleServers/wa-workflow-api-postgres-db-flex-ithc",
        ]
      + severity                 = 1
      + tags                     = (known after apply)
      + target_resource_location = (known after apply)
      + target_resource_type     = (known after apply)
      + window_size              = "PT15M"

      + action {
          + action_group_id = (known after apply)
        }

      + criteria {
          + aggregation            = "Average"
          + metric_name            = "memory_percent"
          + metric_namespace       = "Microsoft.DBforPostgreSQL/flexibleServers"
          + operator               = "GreaterThanOrEqual"
          + skip_metric_validation = false
          + threshold              = 80
        }
    }

  # module.wa_workflow_api_database_flex.azurerm_monitor_metric_alert.db_alert_storage_utilization[0] will be created
  + resource "azurerm_monitor_metric_alert" "db_alert_storage_utilization" {
      + auto_mitigate            = true
      + description              = "Whenever the storage utilization is greater than 80%"
      + enabled                  = true
      + frequency                = "PT5M"
      + id                       = (known after apply)
      + name                     = "db_storage_utilization_wa-workflow-api-postgres-db-flex-ithc"
      + resource_group_name      = "wa-workflow-api-postgres-db-flex-data-ithc"
      + scopes                   = [
          + "/subscriptions/7a4e3bd5-ae3a-4d0c-b441-2188fee3ff1c/resourceGroups/wa-workflow-api-postgres-db-flex-data-ithc/providers/Microsoft.DBforPostgreSQL/flexibleServers/wa-workflow-api-postgres-db-flex-ithc",
        ]
      + severity                 = 1
      + tags                     = (known after apply)
      + target_resource_location = (known after apply)
      + target_resource_type     = (known after apply)
      + window_size              = "PT15M"

      + action {
          + action_group_id = (known after apply)
        }

      + criteria {
          + aggregation            = "Average"
          + metric_name            = "storage_percent"
          + metric_namespace       = "Microsoft.DBforPostgreSQL/flexibleServers"
          + operator               = "GreaterThanOrEqual"
          + skip_metric_validation = false
          + threshold              = 80
        }
    }

  # module.wa_workflow_api_database_flex.azurerm_postgresql_flexible_server.pgsql_server will be updated in-place
  ~ resource "azurerm_postgresql_flexible_server" "pgsql_server" {
        id                            = "/subscriptions/7a4e3bd5-ae3a-4d0c-b441-2188fee3ff1c/resourceGroups/wa-workflow-api-postgres-db-flex-data-ithc/providers/Microsoft.DBforPostgreSQL/flexibleServers/wa-workflow-api-postgres-db-flex-ithc"
        name                          = "wa-workflow-api-postgres-db-flex-ithc"
      ~ tags                          = {
          - "application"         = "task-management"
          - "autoShutdown"        = "true"
          - "builtFrom"           = "https://github.com/HMCTS/wa-workflow-api.git"
          - "businessArea"        = "CFT"
          - "contactSlackChannel" = "#wa-tech"
          - "environment"         = "ithc"
          - "lastUpdated"         = "2024-12-19T15:25:50Z"
          - "managedBy"           = "Work Allocation"
        } -> (known after apply)
        # (18 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.wa_workflow_api_database_flex.azurerm_resource_group.rg[0] will be updated in-place
  ~ resource "azurerm_resource_group" "rg" {
        id         = "/subscriptions/7a4e3bd5-ae3a-4d0c-b441-2188fee3ff1c/resourceGroups/wa-workflow-api-postgres-db-flex-data-ithc"
        name       = "wa-workflow-api-postgres-db-flex-data-ithc"
      ~ tags       = {
          - "application"         = "task-management"
          - "autoShutdown"        = "true"
          - "builtFrom"           = "https://github.com/HMCTS/wa-workflow-api.git"
          - "businessArea"        = "CFT"
          - "contactSlackChannel" = "#wa-tech"
          - "environment"         = "ithc"
          - "lastUpdated"         = "2024-12-19T15:25:50Z"
          - "managedBy"           = "Work Allocation"
        } -> (known after apply)
        # (2 unchanged attributes hidden)
    }

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

This reverts commit ea9b103.
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.

5 participants