Invoking the AWS Lambda function

We can invoke the AWS Lambda function from our program. For testing, we can execute from the Terminal using the AWS CLI. If you have not installed the AWS CLI yet, you can install it by following the instructions at http://docs.aws.amazon.com/cli/latest/userguide/installing.html:

  1. For testing, we invoke our AWS Lambda with the payload {"msg": "this is testing"}. Type the following command:
$ aws lambda invoke --invocation-type RequestResponse --function-name echo-lambda --payload '{"msg": "this is testing"}' output.txt
  1. If successful, you should get the return code as 200 , as shown in the following screenshot:
  1. To see the AWS Lambda function returning, we open the output file. You should see the message output as follows:
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.223.108.119