aws / aws-sam-cli

CLI tool to build, test, debug, and deploy Serverless applications using AWS SAM
https://aws.amazon.com/serverless/sam/
Apache License 2.0
6.5k stars 1.17k forks source link

Feature request: Enhance generate-event to support chained events in common patterns. #7252

Open derekmurawsky opened 2 months ago

derekmurawsky commented 2 months ago

Describe your idea/feature/enhancement

I wish the Sam CLI would support generating events of common patterns in AWS. For example, S3 Create Object -> SQS -> Lambda.

Proposal

This feature could leverage the current subcommand capability and look like: sam local generate-event sqs recieve-message-from-s3.

jysheng123 commented 2 months ago

Are there any specific events that you are talking about? SAM CLI already has some common events to generate for example like sam local generate-event sqs receive-message, if you think there are any other common events, we welcome contributions, these 2 files need to be edited for any new events samcli/lib/generated_sample_events/event-mapping.json and new-event.json

derekmurawsky commented 2 months ago

Yes. Sorry if it wasn't clear, but the example I listed was an sqs event that originated from s3. The goal would be to show what the body of the sqs message would look like if it originated from s3. This would make it very useful for showing event patterns as they flow through multiple services. Another example would be an event bridge event that originated from API gateway. I feel that there would be many more common patterns like this.

jysheng123 commented 2 months ago

Ok thanks for the suggestion, will keep this marked as a feature request and bring it up with the team in the future. In the meantime we welcome any external contribution.