Enable Container Insights + RunningTaskCount alarm (NEEDS ADAM SIGN-OFF)

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.
This commit is contained in:
Adam Moussa 2026-06-17 13:57:48 -04:00
parent c28d5b1170
commit ea173a0966
2 changed files with 9 additions and 3 deletions

View file

@ -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;

View file

@ -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 ─────────────────────────────────────────────────────────