‫Okay, so let's have a look at the synchronous invocations.
‫And actually when we had our code over function,
‫and we just did test, then this was a synchronous invocation
‫because we are waiting for the results of the invocation,
‫and we get it here in this window.
‫If it took maybe two minutes
‫for this invocation to complete,
‫we would have waited two minutes
‫to get the execution results.
‫Very simple, this is what goes on through the UI.
‫The other thing we can test
‫the synchronous invocation with is using the CLI.
‫So I'm going to open AWS CloudShell
‫which is available in my region,
‫otherwise you can just use the CLI for this use case
‫with your terminal,
‫and in here, as we can see the errors command line
‫is available to us.
‫So if I do give us management version
‫we get the fact that it is version 2.1.
‫So this is perfect.
‫Okay. So let's use this CLI to list our functions.
‫So it was Lambda list functions
‫and this should list the functions within the region.
‫Make sure to add the region flag
‫if you're using this CLI so for me, it's EU west 1.
‫if using the CLI in your terminal
‫and not using CloudShell,
‫but here we go, we have found that we have our function name
‫or function ARI and the runtime
‫and so on out of the function that is right here.
‫So next we want to do a synchronous invocation
‫from the CLI of our lambda function, and for this
‫this just go into our code and
‫under a synchronous.sh we have the different commands.
‫So I'm on Linux Mac because this is CloudShell
‫and this is using the CLI V2 versions.
‫So if you see have CLI V1, a version
‫one version is going to be a slightly different
‫for the command line
‫but you should have version two by now.
‫So use this command and then you paste it.
‫And this is going to invoke my function name
‫hello world is going to pass in this payload.
‫And then it's going to write the response
‫of json as a result.
‫And I can remove this region argument right here.
‫Otherwise it's not going to work.
‫So I press enter.
‫And it says a function has not been found, for some reason.
‫So yes, the name is not hello world.
‫It is a demo Lambda in this example.
‫So I'm going to go in here
‫and change the function name to demo lambda.
‫As we can see now this is working, we get a 200 result back.
‫And then if I do go into response to json
‫we get the value 1 as a response to that.
‫I mean, my synchronize invocation has worked.
‫So that's it for this lecture.
‫I hope you liked it.
‫And I will see you in the next lecture.