Skip to content

Commit

Permalink
app: Update template-infra:app to version 0.15.3.post8.dev0+e95981c
Browse files Browse the repository at this point in the history
  • Loading branch information
nava-platform-bot committed Feb 28, 2025
1 parent 843a4a8 commit 15e532b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .template-infra/app-app.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changes here will be overwritten by Copier
_commit: v0.15.3-7-g4d6247b
_commit: v0.15.3-8-ge95981c
_src_path: https://github.com/navapbc/template-infra
app_has_dev_env_setup: true
app_local_port: 3000
Expand Down
12 changes: 12 additions & 0 deletions infra/app/app-config/env-config/monitoring.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
locals {
monitoring_config = {
# Emails to notify for alerts.
# Use this as a simple notification mechanism if you don't have an incident management service.
email_alert_recipients = []

incident_management_service = var.has_incident_management_service ? {
integration_url_param_name = "/monitoring/${var.app_name}/${var.environment}/incident-management-integration-url"
} : null
}
}

6 changes: 2 additions & 4 deletions infra/app/app-config/env-config/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ output "scheduled_jobs" {
value = local.scheduled_jobs
}

output "incident_management_service_integration" {
value = var.has_incident_management_service ? {
integration_url_param_name = "/monitoring/${var.app_name}/${var.environment}/incident-management-integration-url"
} : null
output "monitoring_config" {
value = local.monitoring_config
}

output "network_name" {
Expand Down
10 changes: 5 additions & 5 deletions infra/app/service/monitoring.tf
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
locals {
incident_management_service_integration_config = local.environment_config.incident_management_service_integration
monitoring_config = local.environment_config.monitoring_config
incident_management_service_integration_url = module.app_config.has_incident_management_service && !local.is_temporary ? data.aws_ssm_parameter.incident_management_service_integration_url[0].value : null
}

# Retrieve url for external incident management tool (e.g. Pagerduty, Splunk-On-Call)

data "aws_ssm_parameter" "incident_management_service_integration_url" {
count = module.app_config.has_incident_management_service ? 1 : 0
name = local.incident_management_service_integration_config.integration_url_param_name
name = local.monitoring_config.incident_management_service.integration_url_param_name
}

module "monitoring" {
source = "../../modules/monitoring"
#Email subscription list:
#email_alerts_subscription_list = ["[email protected]", "[email protected]"]

# Module takes service and ALB names to link all alerts with corresponding targets
service_name = local.service_name
load_balancer_arn_suffix = module.service.load_balancer_arn_suffix
incident_management_service_integration_url = module.app_config.has_incident_management_service && !local.is_temporary ? data.aws_ssm_parameter.incident_management_service_integration_url[0].value : null
email_alert_recipients = local.monitoring_config.email_alert_recipients
incident_management_service_integration_url = local.incident_management_service_integration_url
}

0 comments on commit 15e532b

Please sign in to comment.