CloudConsole

CloudWatch alarm: S3 Object Lambda 5xxErrors

Updated 16 November 2026 · How we write and check guides

Short answer

Alarm on AWS/S3ObjectLambda 5xxErrors for the AccessPointName and DataSourceARN, Average over 60 seconds, above 0.05 for 15 consecutive minutes. More than 5% of requests failing with server errors through an Object Lambda Access Point usually means the transformation function is crashing, timing out or responding incorrectly.

Chart of the 5xxErrors alarm: Average per 1-minute period, ALARM when 15 of 15 datapoints are > 0.05
How the recommended alarm evaluates, with AWS's settings from this page. The metric values are illustrative.

Where 5xx errors come from

An Object Lambda request succeeds only if your function runs and calls WriteGetObjectResponse in time. Server-side failures in that chain surface as 5xx to the client:

SourceWhat you will see
Function throws or crashesLambda Errors rises at the same time; stack traces in the function's logs
Function times out or never respondsDuration near the timeout; no WriteGetObjectResponse call
Function is throttledLambda Throttles on the function
Function returns a 5xx itselfFunction logs show the status it chose
S3 service issueErrors across access points; AWS Health event

Large objects make timeouts more likely: the function has to fetch, transform and stream the result within its time limit.

Recommended alarm settings

SettingRecommended value
NamespaceAWS/S3ObjectLambda
Metric5xxErrors
DimensionsAccessPointName, DataSourceARN
StatisticAverage
Threshold0.05
Period60 seconds
Datapoints to alarm15
Evaluation periods15
Comparison operatorGreaterThanThreshold

Tuning

Most Object Lambda access points should run near zero 5xx, so 5% for fifteen minutes is a conservative trigger. For user-facing paths consider 0.01. If you also alarm on the function's Errors and Throttles, keep this one as the customer-impact view: it measures what callers actually received.

It also helps to know your object size profile. If most objects are small but a few are hundreds of megabytes, the large ones are where timeouts and memory exhaustion happen, and they can push the error rate over 5% on their own when traffic is light. In that case, either route large objects through a different path, or raise the function's memory and timeout to cover the worst case, and keep an eye on Duration as a leading indicator. A 5xx rate that rises slowly during the day usually tracks load (throttling or a slow dependency); one that jumps in a single minute usually tracks a deploy.

Create the alarm

aws cloudwatch put-metric-alarm \
  --alarm-name s3ol-redacted-docs-5xx-rate \
  --alarm-description "More than 5% of requests to redacted-docs returning 5xx" \
  --namespace AWS/S3ObjectLambda \
  --metric-name 5xxErrors \
  --dimensions Name=AccessPointName,Value=redacted-docs Name=DataSourceARN,Value=arn:aws:s3:eu-west-2:123456789012:accesspoint/docs-ap \
  --statistic Average \
  --period 60 \
  --evaluation-periods 15 \
  --datapoints-to-alarm 15 \
  --threshold 0.05 \
  --comparison-operator GreaterThanThreshold \
  --treat-missing-data notBreaching \
  --alarm-actions arn:aws:sns:eu-west-2:123456789012:oncall-alerts

When it fires

  1. Check the function first: Errors, Throttles and Duration for the transformation function, and its recent log output.
  2. Roll back if a new function version coincides with the spike; see roll back a Lambda version.
  3. Timeouts: stream the transformation rather than buffering whole objects, raise memory (more CPU) or the timeout.
  4. Throttles: add reserved concurrency for the function or request a higher account quota.
  5. If the function is healthy, check AWS Health for S3 in the Region.

Questions

How do I create a CloudWatch alarm for an S3 bucket?

Enable request metrics on the bucket with a metrics configuration (a filter), then alarm on metrics such as 4xxErrors or 5xxErrors using the BucketName and FilterId dimensions. Daily storage metrics like BucketSizeBytes need no setup but are only updated once a day.

Does a Lambda timeout show as an S3 Object Lambda 5xx?

Yes. If the function never completes its WriteGetObjectResponse call, the client receives a server error, which this metric counts.

When this happens away from your desk

When a transformation function breaks, every download through the access point fails at once. CloudConsole, a phone app for AWS, is built to show the alarm and the function's recent errors together on your phone.

Did it start after a deploy? What changed? on the app’s alarm screen lists the deploys and configuration changes from the hour before the alarm fired.

About the app → · Download on the App Store

Sources