diff --git a/app/stacks/uk-west/applications-service/locals.tf b/app/stacks/uk-west/applications-service/locals.tf index 13da67007..212582aac 100644 --- a/app/stacks/uk-west/applications-service/locals.tf +++ b/app/stacks/uk-west/applications-service/locals.tf @@ -29,7 +29,11 @@ locals { ) fo_applications_tech_emails = [for rec in data.azurerm_monitor_action_group.fo_applications_tech.email_receiver : rec.email_address] - tech_emails = local.fo_applications_tech_emails + # Filter emails to stay under 300 char limit for azurerm_mssql_server_security_alert_policy.email_addresses + tech_emails = [ + for i, email in local.fo_applications_tech_emails : email + if sum([for e in slice(local.fo_applications_tech_emails, 0, i + 1) : length(e) + 1]) <= 300 + ] tags = merge( var.common_tags,