mirror of
https://github.com/Sea-Haven-Industries/front-integrations.git
synced 2026-10-01 03:03:12 +00:00
Freeze SAM CD and add Terraform for seahaven-prod (Lambdas, DynamoDB, EventBridge, alarms) so HCP becomes the sole deploy path. Include prod secret ARNs in the tfvars example for workspace wiring.
41 lines
1.6 KiB
HCL
41 lines
1.6 KiB
HCL
resource "aws_cloudwatch_event_rule" "sla_monitor" {
|
|
name = "front-sla-monitor"
|
|
description = "Check Front conversations for SLA breaches every 15 min during business hours"
|
|
schedule_expression = var.sla_monitor_schedule
|
|
state = local.schedule_state
|
|
}
|
|
|
|
resource "aws_cloudwatch_event_target" "sla_monitor" {
|
|
rule = aws_cloudwatch_event_rule.sla_monitor.name
|
|
target_id = "front-sla-monitor"
|
|
arn = aws_lambda_function.sla_monitor.arn
|
|
}
|
|
|
|
resource "aws_lambda_permission" "sla_monitor_events" {
|
|
statement_id = "AllowExecutionFromEventBridge"
|
|
action = "lambda:InvokeFunction"
|
|
function_name = aws_lambda_function.sla_monitor.function_name
|
|
principal = "events.amazonaws.com"
|
|
source_arn = aws_cloudwatch_event_rule.sla_monitor.arn
|
|
}
|
|
|
|
resource "aws_cloudwatch_event_rule" "user_sync" {
|
|
name = "front-user-sync"
|
|
description = "Sync Google Workspace user profiles to Front daily at 6 AM ET"
|
|
schedule_expression = var.user_sync_schedule
|
|
state = local.schedule_state
|
|
}
|
|
|
|
resource "aws_cloudwatch_event_target" "user_sync" {
|
|
rule = aws_cloudwatch_event_rule.user_sync.name
|
|
target_id = "front-user-sync"
|
|
arn = aws_lambda_function.user_sync.arn
|
|
}
|
|
|
|
resource "aws_lambda_permission" "user_sync_events" {
|
|
statement_id = "AllowExecutionFromEventBridge"
|
|
action = "lambda:InvokeFunction"
|
|
function_name = aws_lambda_function.user_sync.function_name
|
|
principal = "events.amazonaws.com"
|
|
source_arn = aws_cloudwatch_event_rule.user_sync.arn
|
|
}
|