Alarms offer a straightforward way to monitor your infrastructure and receive prompt notifications when your resources experience issues or become overloaded.
You can configure alarms to monitor specific metrics of a resource type. When a metric crosses a predefined threshold, the alarm triggers a configured action, such as sending a notification.
Under the hood, Stacktape alarms are implemented using _CloudWatch Alarm_s.
How to create alarms
There are two ways to create alarms:
- Global alarms are created in the Stacktape Console and apply to all resources of a specific type managed by Stacktape.
- In-config alarms are defined directly within a resource's configuration in your
stacktape.ymlfile.
Global alarms
Global alarms are templates created in the Stacktape Console. When you deploy a stack that matches the alarm's serviceName and stage criteria, Stacktape creates a concrete alarm for each eligible resource in that stack.
When configuring a global alarm, you can specify:
- The resource type and metric to monitor.
- The threshold for the metric.
- Automatic Slack or email notifications.
- The stacks the alarm applies to, based on
serviceNameandstage.
Global alarms only apply to stacks that are created or updated after the alarm is created. If you create a global alarm, you must run the stacktape deploy command to apply it to your existing stacks.
Creating a global alarm
-
Navigate to the Alarms page in the Stacktape Console and click Create new alarm.

-
Configure the alarm. The example below shows an alarm that monitors the error rate of Lambda functions and is limited to the
prodstage.
-
Deploy your stack using the
stacktape deploycommand to create the alarms.
In-config alarms
You can define alarms directly in your stacktape.yml file as a property of the resource you want to monitor.
An in-config alarm consists of three parts:
- Trigger: Specifies the metric to monitor.
- Notifications (optional): Defines where to send notifications when the alarm is triggered.
- Evaluation (optional): Configures the evaluation period for the monitored metric.
LambdaAlarmAPI referencetriggerRequired
Type: LambdaAlarmTrigger
evaluation
How long and how often to evaluate the metric before triggering.
Type: AlarmEvaluation
Controls the evaluation window (period), how many periods to look at, and how many must breach the threshold to fire the alarm. Useful for filtering out short spikes.
notificationTargets
Where to send notifications when the alarm fires — Slack, MS Teams, or email.
Type: Array of AlarmUserIntegration
includeInHistoryDefault: true
Whether alarm state changes should appear in monitoring history.
Type: boolean
description
Custom alarm description used in notification messages and the AWS console.
Type: string
Trigger
The trigger specifies the metric to be monitored.
See the Trigger Types section for a list of all available alarms.
Notifications
You can configure notifications to be sent to Slack, MS Teams, or by email.
Slack:
MS Teams:
Email:
Evaluation
The evaluation section configures the evaluation period for the monitored metric.
AlarmEvaluationAPI referenceperiodDefault: 60
Duration of one evaluation period in seconds. Must be a multiple of 60.
Type: number
evaluationPeriodsDefault: 1
How many recent periods to evaluate. Prevents alarms from firing on short spikes.
Type: number
Example: set to 5 with breachedPeriods: 3 — the alarm fires only if the threshold is breached
in at least 3 of the last 5 periods.
breachedPeriodsDefault: 1
How many periods (within evaluationPeriods) must breach the threshold to fire the alarm.
Type: number
Must be ≤ evaluationPeriods.
Trigger a Lambda function on alarm
You can trigger a Lambda function when an alarm is fired. For more information, see the alarm event documentation.
Trigger types
New trigger types are added regularly. If you have a request for a new trigger, please open a GitHub issue.
Lambda Error Rate
Fires when the percentage of failed Lambda invocations exceeds this value.
LambdaErrorRateTriggerAPI referencetypeRequired
Type: string "lambda-error-rate"
properties.thresholdPercentRequired
Fires when the percentage of failed Lambda invocations exceeds this value.
Type: number
properties.comparisonOperatorDefault: GreaterThanThreshold
How to compare the metric value against the threshold.
Type: string ENUM
Possible values: GreaterThanOrEqualToThresholdGreaterThanThresholdLessThanOrEqualToThresholdLessThanThreshold
Lambda Duration
Default: fires if average duration > threshold. Customize with statistic and comparisonOperator.
LambdaDurationTriggerAPI referencetypeRequired
Type: string "lambda-duration"
properties.thresholdMillisecondsRequired
Fires when Lambda execution time exceeds this value (ms).
Type: number
Default: fires if average duration > threshold. Customize with statistic and comparisonOperator.
properties.comparisonOperatorDefault: GreaterThanThreshold
How to compare the metric value against the threshold.
Type: string ENUM
Possible values: GreaterThanOrEqualToThresholdGreaterThanThresholdLessThanOrEqualToThresholdLessThanThreshold
properties.statisticDefault: avg
How to aggregate metric values within each period: avg, sum, min, max, p90, p95, p99.
Type: string ENUM
Possible values: avgmaxminp90p95p99sum
Database Read Latency
Fires when average read I/O latency exceeds this value (seconds).
RelationalDatabaseReadLatencyTriggerAPI referencetypeRequired
Type: string "database-read-latency"
properties.thresholdSecondsRequired
Fires when average read I/O latency exceeds this value (seconds).
Type: number
properties.comparisonOperatorDefault: GreaterThanThreshold
How to compare the metric value against the threshold.
Type: string ENUM
Possible values: GreaterThanOrEqualToThresholdGreaterThanThresholdLessThanOrEqualToThresholdLessThanThreshold
properties.statisticDefault: avg
How to aggregate metric values within each period: avg, sum, min, max, p90, p95, p99.
Type: string ENUM
Possible values: avgmaxminp90p95p99sum
Database Write Latency
Fires when average write I/O latency exceeds this value (seconds).
RelationalDatabaseWriteLatencyTriggerAPI referencetypeRequired
Type: string "database-write-latency"
properties.thresholdSecondsRequired
Fires when average write I/O latency exceeds this value (seconds).
Type: number
properties.comparisonOperatorDefault: GreaterThanThreshold
How to compare the metric value against the threshold.
Type: string ENUM
Possible values: GreaterThanOrEqualToThresholdGreaterThanThresholdLessThanOrEqualToThresholdLessThanThreshold
properties.statisticDefault: avg
How to aggregate metric values within each period: avg, sum, min, max, p90, p95, p99.
Type: string ENUM
Possible values: avgmaxminp90p95p99sum
Database CPU Utilization
Fires when CPU utilization exceeds this percentage.
RelationalDatabaseCPUUtilizationTriggerAPI referencetypeRequired
Type: string "database-cpu-utilization"
properties.thresholdPercentRequired
Fires when CPU utilization exceeds this percentage.
Type: number
properties.comparisonOperatorDefault: GreaterThanThreshold
How to compare the metric value against the threshold.
Type: string ENUM
Possible values: GreaterThanOrEqualToThresholdGreaterThanThresholdLessThanOrEqualToThresholdLessThanThreshold
properties.statisticDefault: avg
How to aggregate metric values within each period: avg, sum, min, max, p90, p95, p99.
Type: string ENUM
Possible values: avgmaxminp90p95p99sum
Database Free Storage
Default: fires if minimum free storage < threshold.
RelationalDatabaseFreeStorageTriggerAPI referencetypeRequired
Type: string "database-free-storage"
properties.thresholdMBRequired
Fires when free disk space drops below this value (MB).
Type: number
Default: fires if minimum free storage < threshold.
properties.comparisonOperatorDefault: GreaterThanThreshold
How to compare the metric value against the threshold.
Type: string ENUM
Possible values: GreaterThanOrEqualToThresholdGreaterThanThresholdLessThanOrEqualToThresholdLessThanThreshold
properties.statisticDefault: avg
How to aggregate metric values within each period: avg, sum, min, max, p90, p95, p99.
Type: string ENUM
Possible values: avgmaxminp90p95p99sum
Database Free Memory
Default: fires if average free memory < threshold. Customize with statistic and comparisonOperator.
RelationalDatabaseFreeMemoryTriggerAPI referencetypeRequired
Type: string "database-free-memory"
properties.thresholdMBRequired
Fires when free memory drops below this value (MB).
Type: number
Default: fires if average free memory < threshold. Customize with statistic and comparisonOperator.
properties.comparisonOperatorDefault: GreaterThanThreshold
How to compare the metric value against the threshold.
Type: string ENUM
Possible values: GreaterThanOrEqualToThresholdGreaterThanThresholdLessThanOrEqualToThresholdLessThanThreshold
properties.statisticDefault: avg
How to aggregate metric values within each period: avg, sum, min, max, p90, p95, p99.
Type: string ENUM
Possible values: avgmaxminp90p95p99sum
Database Connection Count
Fires when the number of active database connections exceeds this value.
RelationalDatabaseConnectionCountTriggerAPI referencetypeRequired
Type: string "database-connection-count"
properties.thresholdCountRequired
Fires when the number of active database connections exceeds this value.
Type: number
properties.comparisonOperatorDefault: GreaterThanThreshold
How to compare the metric value against the threshold.
Type: string ENUM
Possible values: GreaterThanOrEqualToThresholdGreaterThanThresholdLessThanOrEqualToThresholdLessThanThreshold
properties.statisticDefault: avg
How to aggregate metric values within each period: avg, sum, min, max, p90, p95, p99.
Type: string ENUM
Possible values: avgmaxminp90p95p99sum
Http Api Gateway Error Rate
Fires when 4xx/5xx error rate exceeds this percentage.
HttpApiGatewayErrorRateTriggerAPI referencetypeRequired
Type: string "http-api-gateway-error-rate"
properties.thresholdPercentRequired
Fires when 4xx/5xx error rate exceeds this percentage.
Type: number
properties.comparisonOperatorDefault: GreaterThanThreshold
How to compare the metric value against the threshold.
Type: string ENUM
Possible values: GreaterThanOrEqualToThresholdGreaterThanThresholdLessThanOrEqualToThresholdLessThanThreshold
Http Api Gateway Latency
Default: fires if average latency > threshold. Customize with statistic and comparisonOperator.
HttpApiGatewayLatencyTriggerAPI referencetypeRequired
Type: string "http-api-gateway-latency"
properties.thresholdMillisecondsRequired
Fires when request-to-response latency exceeds this value (ms).
Type: number
Default: fires if average latency > threshold. Customize with statistic and comparisonOperator.
properties.comparisonOperatorDefault: GreaterThanThreshold
How to compare the metric value against the threshold.
Type: string ENUM
Possible values: GreaterThanOrEqualToThresholdGreaterThanThresholdLessThanOrEqualToThresholdLessThanThreshold
properties.statisticDefault: avg
How to aggregate metric values within each period: avg, sum, min, max, p90, p95, p99.
Type: string ENUM
Possible values: avgmaxminp90p95p99sum
Application Load Balancer Error Rate
Example: 5 fires the alarm if more than 5% of requests return errors.
ApplicationLoadBalancerErrorRateTriggerAPI referencetypeRequired
Type: string "application-load-balancer-error-rate"
properties.thresholdPercentRequired
Fires when 4xx/5xx error rate exceeds this percentage.
Type: number
Example: 5 fires the alarm if more than 5% of requests return errors.
properties.comparisonOperatorDefault: GreaterThanThreshold
How to compare the metric value against the threshold.
Type: string ENUM
Possible values: GreaterThanOrEqualToThresholdGreaterThanThresholdLessThanOrEqualToThresholdLessThanThreshold
Application Load Balancer Custom
The threshold will be compared against the calculated value of statistic(METRIC), where:
statisticis the function applied to the metric values collected during the evaluation period (default:avg).METRICis the chosen metric.
Available Metrics:
ActiveConnectionCount: The total number of concurrent TCP connections active from clients to the load balancer and from the load balancer to targets.AnomalousHostCount: The number of hosts detected with anomalies.ClientTLSNegotiationErrorCount: The number of TLS connections initiated by the client that did not establish a session with the load balancer due to a TLS error.ConsumedLCUs: The number of load balancer capacity units (LCU) used by your load balancer.DesyncMitigationMode_NonCompliant_Request_Count: The number of requests that do not comply with RFC 7230.DroppedInvalidHeaderRequestCount: The number of requests where the load balancer removed HTTP headers with invalid fields before routing the request.MitigatedHostCount: The number of targets under mitigation.ForwardedInvalidHeaderRequestCount: The number of requests routed by the load balancer that had HTTP headers with invalid fields.GrpcRequestCount: The number of gRPC requests processed over IPv4 and IPv6.HTTP_Fixed_Response_Count: The number of successful fixed-response actions.HTTP_Redirect_Count: The number of successful redirect actions.HTTP_Redirect_Url_Limit_Exceeded_Count: The number of redirect actions that failed because the URL in the response location header exceeded 8K.HTTPCode_ELB_3XX_Count: The number of HTTP 3XX redirection codes originating from the load balancer.HTTPCode_ELB_4XX_Count: The number of HTTP 4XX client error codes originating from the load balancer.HTTPCode_ELB_5XX_Count: The number of HTTP 5XX server error codes originating from the load balancer.HTTPCode_ELB_500_Count: The number of HTTP 500 error codes originating from the load balancer.HTTPCode_ELB_502_Count: The number of HTTP 502 error codes originating from the load balancer.HTTPCode_ELB_503_Count: The number of HTTP 503 error codes originating from the load balancer.HTTPCode_ELB_504_Count: The number of HTTP 504 error codes originating from the load balancer.IPv6ProcessedBytes: The total number of bytes processed by the load balancer over IPv6.IPv6RequestCount: The number of IPv6 requests received by the load balancer.NewConnectionCount: The total number of new TCP connections established from clients to the load balancer and from the load balancer to targets.NonStickyRequestCount: The number of requests where the load balancer chose a new target because it could not use an existing sticky session.ProcessedBytes: The total number of bytes processed by the load balancer over IPv4 and IPv6.RejectedConnectionCount: The number of connections rejected because the load balancer reached its maximum number of connections.RequestCount: The number of requests processed over IPv4 and IPv6.RuleEvaluations: The number of rules processed by the load balancer, averaged over an hour.HealthyHostCount: The number of targets that are considered healthy.HTTPCode_Target_2XX_Count: The number of HTTP 2XX response codes generated by the targets.HTTPCode_Target_3XX_Count: The number of HTTP 3XX response codes generated by the targets.HTTPCode_Target_4XX_Count: The number of HTTP 4XX response codes generated by the targets.HTTPCode_Target_5XX_Count: The number of HTTP 5XX response codes generated by the targets.RequestCountPerTarget: The average number of requests per target in a target group.TargetConnectionErrorCount: The number of connections that were not successfully established between the load balancer and a target.TargetResponseTime: The time elapsed (in seconds) from when a request leaves the load balancer until the target starts sending response headers.TargetTLSNegotiationErrorCount: The number of TLS connections initiated by the load balancer that did not establish a session with the target.UnHealthyHostCount: The number of targets that are considered unhealthy.HealthyStateDNS: The number of zones that meet the DNS healthy state requirements.HealthyStateRouting: The number of zones that meet the routing healthy state requirements.UnhealthyRoutingRequestCount: The number of requests routed using the routing failover action (fail open).UnhealthyStateDNS: The number of zones that do not meet the DNS healthy state requirements.UnhealthyStateRouting: The number of zones that do not meet the routing healthy state requirements.LambdaInternalError: The number of requests to a Lambda function that failed due to an issue internal to the load balancer or AWS Lambda.LambdaTargetProcessedBytes: The total number of bytes processed by the load balancer for requests to and responses from a Lambda function.LambdaUserError: The number of requests to a Lambda function that failed due to an issue with the Lambda function itself.ELBAuthError: The number of user authentications that could not be completed due to an internal error.ELBAuthFailure: The number of user authentications that could not be completed because the IdP denied access.ELBAuthLatency: The time elapsed (in milliseconds) to query the IdP for the ID token and user info.ELBAuthRefreshTokenSuccess: The number of times the load balancer successfully refreshed user claims using a refresh token.ELBAuthSuccess: The number of successful authentication actions.ELBAuthUserClaimsSizeExceeded: The number of times a configured IdP returned user claims that exceeded 11K bytes in size.
ApplicationLoadBalancerCustomTriggerAPI referencetypeRequired
Type: string "application-load-balancer-custom"
properties.metricRequired
The metric to monitor on the Load Balancer.
Type: string ENUM
Possible values: ActiveConnectionCountAnomalousHostCountClientTLSNegotiationErrorCountConsumedLCUsDesyncMitigationMode_NonCompliant_Request_CountDroppedInvalidHeaderRequestCountELBAuthErrorELBAuthFailureELBAuthLatencyELBAuthRefreshTokenSuccessELBAuthSuccessELBAuthUserClaimsSizeExceededForwardedInvalidHeaderRequestCountGrpcRequestCountHTTPCode_ELB_3XX_CountHTTPCode_ELB_4XX_CountHTTPCode_ELB_500_CountHTTPCode_ELB_502_CountHTTPCode_ELB_503_CountHTTPCode_ELB_504_CountHTTPCode_ELB_5XX_CountHTTPCode_Target_2XX_CountHTTPCode_Target_3XX_CountHTTPCode_Target_4XX_CountHTTPCode_Target_5XX_CountHTTP_Fixed_Response_CountHTTP_Redirect_CountHTTP_Redirect_Url_Limit_Exceeded_CountHealthyHostCountHealthyStateDNSHealthyStateRoutingIPv6ProcessedBytesIPv6RequestCountLambdaInternalErrorLambdaTargetProcessedBytesLambdaUserErrorMitigatedHostCountNewConnectionCountNonStickyRequestCountProcessedBytesRejectedConnectionCountRequestCountRequestCountPerTargetRuleEvaluationsTargetConnectionErrorCountTargetResponseTimeTargetTLSNegotiationErrorCountUnHealthyHostCountUnhealthyRoutingRequestCountUnhealthyStateDNSUnhealthyStateRouting
The threshold will be compared against the calculated value of statistic(METRIC), where:
statisticis the function applied to the metric values collected during the evaluation period (default:avg).METRICis the chosen metric.
Available Metrics:
ActiveConnectionCount: The total number of concurrent TCP connections active from clients to the load balancer and from the load balancer to targets.AnomalousHostCount: The number of hosts detected with anomalies.ClientTLSNegotiationErrorCount: The number of TLS connections initiated by the client that did not establish a session with the load balancer due to a TLS error.ConsumedLCUs: The number of load balancer capacity units (LCU) used by your load balancer.DesyncMitigationMode_NonCompliant_Request_Count: The number of requests that do not comply with RFC 7230.DroppedInvalidHeaderRequestCount: The number of requests where the load balancer removed HTTP headers with invalid fields before routing the request.MitigatedHostCount: The number of targets under mitigation.ForwardedInvalidHeaderRequestCount: The number of requests routed by the load balancer that had HTTP headers with invalid fields.GrpcRequestCount: The number of gRPC requests processed over IPv4 and IPv6.HTTP_Fixed_Response_Count: The number of successful fixed-response actions.HTTP_Redirect_Count: The number of successful redirect actions.HTTP_Redirect_Url_Limit_Exceeded_Count: The number of redirect actions that failed because the URL in the response location header exceeded 8K.HTTPCode_ELB_3XX_Count: The number of HTTP 3XX redirection codes originating from the load balancer.HTTPCode_ELB_4XX_Count: The number of HTTP 4XX client error codes originating from the load balancer.HTTPCode_ELB_5XX_Count: The number of HTTP 5XX server error codes originating from the load balancer.HTTPCode_ELB_500_Count: The number of HTTP 500 error codes originating from the load balancer.HTTPCode_ELB_502_Count: The number of HTTP 502 error codes originating from the load balancer.HTTPCode_ELB_503_Count: The number of HTTP 503 error codes originating from the load balancer.HTTPCode_ELB_504_Count: The number of HTTP 504 error codes originating from the load balancer.IPv6ProcessedBytes: The total number of bytes processed by the load balancer over IPv6.IPv6RequestCount: The number of IPv6 requests received by the load balancer.NewConnectionCount: The total number of new TCP connections established from clients to the load balancer and from the load balancer to targets.NonStickyRequestCount: The number of requests where the load balancer chose a new target because it could not use an existing sticky session.ProcessedBytes: The total number of bytes processed by the load balancer over IPv4 and IPv6.RejectedConnectionCount: The number of connections rejected because the load balancer reached its maximum number of connections.RequestCount: The number of requests processed over IPv4 and IPv6.RuleEvaluations: The number of rules processed by the load balancer, averaged over an hour.HealthyHostCount: The number of targets that are considered healthy.HTTPCode_Target_2XX_Count: The number of HTTP 2XX response codes generated by the targets.HTTPCode_Target_3XX_Count: The number of HTTP 3XX response codes generated by the targets.HTTPCode_Target_4XX_Count: The number of HTTP 4XX response codes generated by the targets.HTTPCode_Target_5XX_Count: The number of HTTP 5XX response codes generated by the targets.RequestCountPerTarget: The average number of requests per target in a target group.TargetConnectionErrorCount: The number of connections that were not successfully established between the load balancer and a target.TargetResponseTime: The time elapsed (in seconds) from when a request leaves the load balancer until the target starts sending response headers.TargetTLSNegotiationErrorCount: The number of TLS connections initiated by the load balancer that did not establish a session with the target.UnHealthyHostCount: The number of targets that are considered unhealthy.HealthyStateDNS: The number of zones that meet the DNS healthy state requirements.HealthyStateRouting: The number of zones that meet the routing healthy state requirements.UnhealthyRoutingRequestCount: The number of requests routed using the routing failover action (fail open).UnhealthyStateDNS: The number of zones that do not meet the DNS healthy state requirements.UnhealthyStateRouting: The number of zones that do not meet the routing healthy state requirements.LambdaInternalError: The number of requests to a Lambda function that failed due to an issue internal to the load balancer or AWS Lambda.LambdaTargetProcessedBytes: The total number of bytes processed by the load balancer for requests to and responses from a Lambda function.LambdaUserError: The number of requests to a Lambda function that failed due to an issue with the Lambda function itself.ELBAuthError: The number of user authentications that could not be completed due to an internal error.ELBAuthFailure: The number of user authentications that could not be completed because the IdP denied access.ELBAuthLatency: The time elapsed (in milliseconds) to query the IdP for the ID token and user info.ELBAuthRefreshTokenSuccess: The number of times the load balancer successfully refreshed user claims using a refresh token.ELBAuthSuccess: The number of successful authentication actions.ELBAuthUserClaimsSizeExceeded: The number of times a configured IdP returned user claims that exceeded 11K bytes in size.
properties.thresholdRequired
The threshold that triggers the alarm.
Type: number
The threshold is compared against the calculated value of statistic(METRIC), where:
statisticis the function applied to the metric values collected during the evaluation period (default:avg).METRICis the chosen metric.
properties.statisticDefault: avg
How to aggregate metric values within each period: avg, sum, min, max, p90, p95, p99.
Type: string ENUM
Possible values: avgmaxminp90p95p99sum
properties.comparisonOperatorDefault: GreaterThanThreshold
How to compare the metric value against the threshold.
Type: string ENUM
Possible values: GreaterThanOrEqualToThresholdGreaterThanThresholdLessThanOrEqualToThresholdLessThanThreshold
Sqs Queue Received Messages
Default: fires if average messages received per period > thresholdCount.
Customize with statistic and comparisonOperator.
SqsQueueReceivedMessagesCountTriggerAPI referencetypeRequired
Type: string "sqs-queue-received-messages-count"
properties.thresholdCountRequired
Fires when received message count crosses this threshold.
Type: number
Default: fires if average messages received per period > thresholdCount.
Customize with statistic and comparisonOperator.
properties.comparisonOperatorDefault: GreaterThanThreshold
How to compare the metric value against the threshold.
Type: string ENUM
Possible values: GreaterThanOrEqualToThresholdGreaterThanThresholdLessThanOrEqualToThresholdLessThanThreshold
properties.statisticDefault: avg
How to aggregate metric values within each period: avg, sum, min, max, p90, p95, p99.
Type: string ENUM
Possible values: avgmaxminp90p95p99sum
Sqs Queue Not Empty
The queue is considered "not empty" if any of these are non-zero: visible messages, in-flight messages, messages received, or messages sent.
SqsQueueNotEmptyTriggerAPI referencetypeRequired
Fires when the SQS queue has unprocessed messages.
Type: string "sqs-queue-not-empty"
The queue is considered "not empty" if any of these are non-zero: visible messages, in-flight messages, messages received, or messages sent.