From ea173a096697cbdb213a9287ec58a44caa7cb70b Mon Sep 17 00:00:00 2001 From: Adam Moussa Date: Wed, 17 Jun 2026 13:57:48 -0400 Subject: [PATCH] Enable Container Insights + RunningTaskCount alarm (NEEDS ADAM SIGN-OFF) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Enable Container Insights on the seahaven-socket-mode ECS cluster and add the seahaven-socket-mode-running-tasks alarm (fires when running tasks < 1 against desiredCount=1). RunningTaskCount is only published with Container Insights enabled, which adds CloudWatch metric + log-ingestion cost. This is isolated in its own commit so it can be dropped if the cost/config change is declined — revert this commit (cluster containerInsightsV2 + enableRunningTaskAlarm flag) and the rest of the alarm coverage is unaffected. --- lib/constructs/socket-mode.ts | 4 ++++ lib/seahaven-slack-bot-stack.ts | 8 +++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/constructs/socket-mode.ts b/lib/constructs/socket-mode.ts index b765222..470f699 100644 --- a/lib/constructs/socket-mode.ts +++ b/lib/constructs/socket-mode.ts @@ -27,6 +27,10 @@ export class SocketModeConstruct extends Construct { const cluster = new ecs.Cluster(this, 'Cluster', { clusterName: 'seahaven-socket-mode', vpc: props.vpc, + // Container Insights publishes ECS/ContainerInsights metrics (incl. + // RunningTaskCount) needed for the task-count alarm. This adds CloudWatch + // metric + log cost — see PR body "NEEDS ADAM SIGN-OFF (cost/config)". + containerInsightsV2: ecs.ContainerInsights.ENABLED, }); this.cluster = cluster; diff --git a/lib/seahaven-slack-bot-stack.ts b/lib/seahaven-slack-bot-stack.ts index 0b1fdbd..40581e4 100644 --- a/lib/seahaven-slack-bot-stack.ts +++ b/lib/seahaven-slack-bot-stack.ts @@ -116,9 +116,11 @@ export class SeahavenSlackBotStack extends cdk.Stack { httpApi: slackHandler.api, ecsService: socketMode.service, ecsCluster: socketMode.cluster, - // RunningTaskCount alarm requires Container Insights (cost/config change) — - // gated off by default; enabled in a separate, sign-off-gated commit. - enableRunningTaskAlarm: false, + // RunningTaskCount alarm requires Container Insights, enabled on the + // socket-mode cluster (see socket-mode.ts). This adds CloudWatch metric + + // log cost — flagged in the PR as "NEEDS ADAM SIGN-OFF (cost/config)". + // Drop this commit (and the cluster's containerInsightsV2 line) to decline. + enableRunningTaskAlarm: true, }); // ── Stack outputs ─────────────────────────────────────────────────────────