Yes, as of SAM CLI v1.98.0. That release introduced support for Lambda shareable test events.
Shareable test events are test events that you can share with other users in the same AWS account. You can edit other users' shareable test events and invoke your function with them.
Shareable test events are visible from the Lamba console alongside the old console test events.1
The sam remote test-event command has put
, list
, get
and delete
subcommands to manage shareable test events. For instance, the put subcommand creates or updates an event. Events are associated with a Lambda function by LogicalID+Stack or ARN, which are passed as an argument:
sam remote test-event put <Lambda Logical ID> --stack-name MyStack --file event.json --name MyEvent
sam remote test-event put <Lambda ARN> --file event.json --name MyEvent
Invoke a remote function with a shareable test event using the --test-event-name
option.2, passing the event name:
sam remote invoke <Lambda Logical ID> --stack-name MyStack --test-event-name MyEvent
- Shareable test events are stored in an EventBridge schema registry named
lambda-testevent-schemas
in your account. IAM access to shared events is governed through permissions on the registry.
- The new
--test-event-name
option uses a remote sharable test event. The existing --event-file
option uses a local json event.