aws-sam-cli icon indicating copy to clipboard operation
aws-sam-cli copied to clipboard

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

Open derekmurawsky opened this issue 1 year ago • 3 comments

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.

derekmurawsky avatar Jul 16 '24 21:07 derekmurawsky

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

jysheng123 avatar Jul 16 '24 21:07 jysheng123

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.

derekmurawsky avatar Jul 17 '24 01:07 derekmurawsky

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.

jysheng123 avatar Jul 17 '24 17:07 jysheng123