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

init an internal lambda function?

Open kaihendry opened this issue 5 years ago • 5 comments

sam init --runtime go1.x appears to create an API gateway type of function. What happens if I want to create a function that gets triggered by SNS or some direct lambda call (with JSON payload) instead??

kaihendry avatar Apr 18 '19 08:04 kaihendry

you can always sam local invoke{functyion_name} --event event.json. You should be able to specify an event you want with sam local generate-event.

Other events are listed here: https://github.com/aws/aws-lambda-go/tree/master/events

sriram-mv avatar Apr 18 '19 16:04 sriram-mv

Nonetheless my template.yaml has this API gateway cruft, no?

kaihendry avatar Apr 19 '19 07:04 kaihendry

the init also creates a hello-world directory. Ideally main.go is in the top level directory as to not break a go get.

kaihendry avatar Sep 19 '19 02:09 kaihendry

Current generated Makefile is missing sam {package,deploy} stanzas making it pretty useless.

kaihendry avatar Sep 19 '19 02:09 kaihendry

Bit confused at what the baseline role should be for a function. Ideally this template would get you going with that question.

kaihendry avatar Sep 19 '19 02:09 kaihendry

There are a bunch more patterns at https://serverlessland.com/patterns I'm going to close this issue in favor of that, we can re-open this issue if there are other use cases that need to be supported.

sriram-mv avatar Oct 03 '22 23:10 sriram-mv