CDCgov / trusted-intermediary

Bringing together healthcare providers by reducing the connection burden.
Apache License 2.0
11 stars 5 forks source link

Azure Alerts for Errors - 4xx status codes #1396

Open scleary1cs opened 2 weeks ago

scleary1cs commented 2 weeks ago

Story

As a developer, I need CDC-TI 4xx status codes to be alerted on after a threshold, so that we can begin an incident.

Pre-conditions

Acceptance Criteria

Tasks

Research

Engineering

Definition of Done

Research Questions

Decisions

Notes

saquino0827 commented 1 day ago

For this alert I believe we need the following:

saquino0827 commented 9 hours ago

We attempted creating a list of variables for the lifecycle ignore changes block.

cdc_tags = 
set(
    "business_steward",
    "center",
    "environment",
    "escid",
    "funding_source",
    "pii_data",
    "security_compliance",
    "security_steward",
    "support_group",
    "system",
    "technical_steward",
    "zone"
 )
  ignore_tags = [for tag in cdc_tags : "tags[\"${tag}\"]"]

With

lifecycle {
    ignore_changes = local.ignore_tags
  }

And we get the following error

 Error: Invalid expression
│
│   on ../../template/alert.tf line 111, in resource "azurerm_monitor_metric_alert" "azure_4XX_alert":
│  111:     ignore_changes = local.ignore_tags
│
│ A static list expression is required.

We'll revert back to the old lifecycle ignore changes list as there doesn't seem to be a better way to do this. We could add it to the provider of azurerm but that would ignore all the tags in every azure resource and I think we use those tags in some resources.