Skip to main content

Overview

OpenSRE integrates with AWS Lambda to inspect function configuration, retrieve recent invocation logs from CloudWatch, and investigate runtime failures during incident response. All operations are read-only.

Prerequisites

  • An AWS account with AWS Lambda functions
  • AWS credentials configured for the runtime (see AWS)
  • Permission to access Lambda and CloudWatch Logs

Setup

Lambda has no separate setup target. Configure the AWS integration:

Environment variables

Add the following to your .env (ambient credential chain used by Lambda tools):
*Or use an instance/task role / shared profile instead of static keys. There are no Lambda-specific environment variables.

Credentials

Lambda tools build clients through the ambient boto3 credential chain. They do not assume AWS_ROLE_ARN for API calls — that role is used by opensre integrations verify aws when set. Give the running identity permission to:
  • Call Lambda read APIs (lambda:List*, lambda:Get*, and related describe/get actions your account uses)
  • Read CloudWatch Logs (logs:FilterLogEvents, logs:GetLogEvents) for invocation history
If you already use the AWS managed ReadOnlyAccess policy on that identity, both are covered. See also the least-privilege example on the AWS page.

Tools

Gotcha

Lambda invocation history is retrieved from CloudWatch Logs. Ensure the configured AWS credentials have permission to access both AWS Lambda and CloudWatch Logs, otherwise log retrieval may fail even if Lambda access succeeds.

Verify

There is no separate aws_lambda verify target. A successful AWS verify confirms the account credentials OpenSRE uses; Lambda tools then use the ambient credential chain when called. Expected output (example):

Troubleshooting

Security

  • All Lambda tools are read-only.
  • Prefer IAM roles over long-lived static keys.
  • Scope permissions to the functions and log groups you want OpenSRE to inspect.
  • Store credentials in .env or your secret manager — not in source control.