@@tomasztarnowski4434 is there a way to scan dynamodb to get the list ordered by LIFO
@tomasztarnowski4434
2 жыл бұрын
Hey Solomon, there is a way but you need to either make the field you want to sort by a "Sort Key" or create a secondary index specifying that field again as a "Sort Key", then with the usage of Query method you can utilise ScanIndexForward parameter to get items in order
@jordivallverdu6200
Жыл бұрын
Would be nice to have a second part with authentication and authorization, also with some fron end fro users to request acces. Just an idea ! Thanks fro the great video
@nftsasha
7 ай бұрын
Very useful, thanks. Had to run "npm install" before deploy after adding uuid and then yup dependencies, or it would fail on the server once API is called since after yarn alone apparently packages are not being deployed.
@martindanielperezpuchuri3112
2 жыл бұрын
new sub, great video, your wallpaper is 10/10
@tomasztarnowski4434
2 жыл бұрын
Thank you, Martin!
@ol1175
Жыл бұрын
Wow, thank you so much. Really love your tutorials. Would be really nice to create an authoriser for our API gateway! Thank you mate!
@tomasztarnowski4434
Жыл бұрын
Thank you, I'm glad you liked the video. Authentication in serverless will be most likely the next topic. There should be a new video about it soon.
@emiremark2889
2 жыл бұрын
Thank you .. this was a great video and got me started. great content will watch all other videos :)
@tomasztarnowski4434
2 жыл бұрын
glad to hear it, emi!
@nipunchathuranga3807
6 ай бұрын
Thanks ! You validation part is very valuable ❤
@sciency_stuff
Жыл бұрын
Hey dude. This video was so useful. I have one question though. Where's the DB located? When I sign up to my IAM and go to DynaoDB I do not see ProductsTable. Then where is it located?
@sciency_stuff
Жыл бұрын
Ohh Damn! The table is created in the AWS location specified in the config. Thanks a ton :)
@tomasztarnowski4434
Жыл бұрын
That is correct! I'm happy you've managed to figure this out yourself!
@vatsalpatel3669
Жыл бұрын
very simple and well explained (:
@tomasztarnowski4434
Жыл бұрын
thank you, vatsal!
@mattriese8143
2 жыл бұрын
Can you explain why you use .promise() but don't set that promise to a variable to process fulfilled/rejected states? For example, in createProduct() you have: await docClient .put({ TableName: tableName, Item: product, }) .promise(); You add it at 15:30, but I don't really understand what the .promise() is doing
@tomasztarnowski4434
2 жыл бұрын
hey Matt, very good question ".promise()" method is a part of AWS SDK and it turns entire expression's result (in this case docClient.put(...)) into a javascript Promise object, so you can use either older .then(), .catch() syntax or new async await. If I hadn't put .promise() after "put" method I wouldn't have been able to await for this operation to complete. Here's also good explanation in AWS docs with older syntax hopefully it'll help you to grasp it: docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/using-promises.html And here how to rewrite .then(), .catch() to async-await: developer.mozilla.org/en-US/docs/Learn/JavaScript/Asynchronous/Async_await#rewriting_promise_code_with_asyncawait
@mattriese8143
2 жыл бұрын
@@tomasztarnowski4434 ah, ok! So if that async docClient.put() call fails, would the catch block (that eventually) wraps it catch the error? what would happen if it was never wrapped in a try/catch block? (thanks for your help!!)
@tomasztarnowski4434
2 жыл бұрын
if you want to catch that error and have some specific response sent from lambda you can put it in a try-catch block however if you don't in aws lambda environment it is going to fail, log an error in cloudwatch and respond with 500 status code and generic internal server error response body :)
@eR1cK92
2 жыл бұрын
I can use that syntsx on the events within framework serverless? Mybresources on aws are deployed by terraform and just need yo creare the code for lambda function and tests And my api is a api websockets
@tomasztarnowski4434
2 жыл бұрын
if your resources are deployed separately you need to link them in iamRoleStatements to give lambdas permissions to access them. If your api is websockets it works differently to the one presented in the video. Although I'll have a new video out soon specifically about API Gateway Websockets. I hope it'll help :)
@eR1cK92
2 жыл бұрын
@@tomasztarnowski4434 I'm waiting for that
@louissasha
Жыл бұрын
great tutorial
@tomasztarnowski4434
Жыл бұрын
Thank you, Sasha Louis!
@nwigweuzochukwu6089
2 жыл бұрын
Can we see a similar video which follows a aTDD approach?
@tomasztarnowski4434
2 жыл бұрын
I'm a big fan of TDD myself and very often use this approach in my professional work, so yeah definitely there will be videos in the future where I build something with tests.
@luuquanghung
2 жыл бұрын
Thanks for the great video. I got the error: The CloudFormation template is invalid: Template error: instance of Fn::GetAtt references undefined resource ProductsTable. How can I fix it?
@tomasztarnowski4434
2 жыл бұрын
Hey Luu, Have you got "resources" section defined in serverless.yml with correct indentations like here: github.com/ttarnowski/serverless-product-api/blob/main/serverless.yml ?
@rakeshrockb
11 ай бұрын
Thank you so much.
@tosinolugbenga2904
Жыл бұрын
I got an error Stack [product-api-dev] does not exist
@tomasztarnowski4434
Жыл бұрын
at which point do you get this error?
@M.ojo.M
7 ай бұрын
Hi bro, I have a company as AWS solutions architect, I am still in training, I dont have knowledge of html/css/js/node.js rest-api dynamo.db, is it necessary for me to learn all these then create a application and test in AWS ?
@spacetium1312
Жыл бұрын
each time I deploy using serverless deploy I get this error after some time loading Serverless: Uploading service products-api.zip file to S3 (16.88 MB)... Serverless: Recoverable error occurred (Your socket connection to the server was not read from or written to within the timeout period. Idle connections will be closed.), sleeping for ~5 seconds. Try 1 of 4 I searched everywhere and no solution
@khoahoc8879
Жыл бұрын
thanks your tutorial
@TCErnesto
2 жыл бұрын
you're not using Express.js right?
@tomasztarnowski4434
Жыл бұрын
Hey, no, for lambda function you don't need to use express as it's a simple function that takes a request object and is supposed to return a response object. However you can still use express.js syntax if you'd like by using this wrapper library: github.com/vendia/serverless-express.
@lordpablo1985
2 жыл бұрын
Don't use aws-sdk, its outdated. Use the modular v3 SDK.
@tomasztarnowski4434
2 жыл бұрын
I'll be switching to v3 SDK since it's recommended by AWS now, although this example of an serverless app is still going to work just fine with v2
@lordpablo1985
2 жыл бұрын
@@tomasztarnowski4434 now? It's been recommended for nearly 2 years!
@tomasztarnowski4434
2 жыл бұрын
I've always been very conservative with using the newest versions until they reach a proper stability.
@lordpablo1985
2 жыл бұрын
@@tomasztarnowski4434 same here. V3 has been deemed stable for long enough now though.
@tomasztarnowski4434
2 жыл бұрын
Agree.
@browaruspierogus2182
2 жыл бұрын
Amazon SDKs tend to get very ugly and abandoned in future
@tomasztarnowski4434
2 жыл бұрын
I wouldn't say it gets abandoned. They have a maintenance policy in place: docs.aws.amazon.com/sdkref/latest/guide/maint-policy.html also, there's a communication channel for any deprecation updates
Пікірлер: 47