Lambda Function

With Testlum you can automatically test your lambda functions from AWS services.

Lambda Integration

Description

<lambdaIntegration> - command for integration with lambda

Required parameters

  1. alias - unique name of the integration

  2. enabled – a boolean flag to enable/disable integration (can be “true” or “false”)

  3. region - the AWS Region

  4. endpoint - endpoint URL

  5. accessKey and secretAccessKey - your AWS credentials

<integrations> <lambdaIntegration> <lambda alias="AWS" enabled="true"> <region>us-east-1</region> <endpoint>https://example-url.com</endpoint> <accessKeyId>test</accessKeyId> <secretAccessKey>test</secretAccessKey> </lambda> </lambdaIntegration> </integrations>

How to send the query

Description

<lambda> - command which is responsible for sending the lambda queries in testing scenarios

Required parameters

  1. comment

  2. alias

  3. functionName

  4. body:

  • from – file

  • raw – string

  1. response:

  • code (default 200)

  • file

  • header (optional): name, data

<lambda comment="Invoke python function" alias="AWS" functionName="hello-world-python"> <body> <from file="body_1.json"/> </body> <response file="expected_1.json"> <header name="X-Amz-Executed-Version" data="$LATEST"/> </response> </lambda> <lambda comment="Invoke python function" alias="AWS" functionName="hello-world-python"> <body> <raw> { "key1": "Hello Lambda", "key2": "value2", "key3": "value3" } </raw> </body> <response file="expected_2.json"/> </lambda>

body_1.json file example

{ "key1": "Hello Lambda", "key2": "value2", "key3": "value3" }

expected_1.json file example

"Hello Lambda"