I recently explored serverless and I would like to create a "kind of simple" backend for my app. It should like CRUD connected to DynamoDB like it is nicely shown here. And then later converted into logging users with Cognito. Link1 and link2 (
During my implementation I have got into a few issue and would like to ask you for help because I don't like using something I only copied and don't exactly know how it is working:
Using callbacks vs returns in lambda functions Please can you describe the difference between these two? I have found some resources on this, however, they won't clear it for me. On Amazon Docs and here Stack overflow.
Why I don't need to set CORS (headers) when initializing lambdas with serverless as opposed to lambda functions created in the amazon console (like here)?
In serverless frameworks what is the difference between
functions.events.httpandfunctions.events.httpapi?Serverless.yml Is there any guide to YAML? I understand that Amazon writing user guides and templates like AWS::IAM::Role or for Dynamo Tables and all others. And also that resources make a cloudformation but what is the purpose for example for Lambda functions listing there when I create/code them? To reference them? Add them privileges?
Also how the referencing works there? Do I only specify resources that should be created or can I also reference already existing ones via ARN? If so how?
Do the policies are only set globally like documentation showing or the only other option is to use plugin serverless-iam-roles-per-function? The same question could be applied to roles and policies in resources.
I am just overwhelmed with the documentation and all the different guides and sometimes can't find the right answers. I appreciate any answers to any of my questions! I like serverless functions and see huge potential in it and therefore want to get more knowledge about it and start using it more :)
Cheers and thanks in advance Lukas!