getlift / lift

Expanding Serverless Framework beyond functions using the AWS CDK
MIT License
912 stars 111 forks source link

Queue :send should support --body-file as well as --body #314

Open tomchiverton opened 1 year ago

tomchiverton commented 1 year ago

Start from the Use-case

SQS function bodies can be complicated, and managing multiple different ones across a team is hard work when all you have is a shell history.

Example Config

n/a

Implementation Idea

serverless some-queue:send --stage QA --group-id=test --body-file tests/send-invalid-to-some-queue.json

mnapoli commented 1 year ago

Sounds like a good improvement to have, a PR would be welcome 👍

tomchiverton commented 1 year ago

If I had any idea where the command line parser was, I could probably take an initial stab.

tomchiverton commented 1 year ago

I assume I add to commands @ https://github.com/getlift/lift/blob/master/src/constructs/aws/Queue.ts and write a new handler based on https://github.com/getlift/lift/blob/master/src/constructs/aws/Queue.ts#L536

mnapoli commented 1 year ago

We don't need a new command, but a new option. I think you should probably modify that line: https://github.com/getlift/lift/blob/master/src/constructs/aws/Queue.ts#L552

tomchiverton commented 1 year ago

I'm also not familiar enough with the project to know how to set up a local version to test with. If this wasn't TypeScript (that needs a build step ?) I could just edit the file in my project's node_modules and see what happened.

So how do I work on this ?