AWS Lambda

The AWS Lambda action connector lets you configure and execute a Lambda function that is invoked in response to an event generated in Contentstack.

NoteYou need to define the Lambda function in your AWS Services console before configuring it for the Automations AWS Lambda action connector.

For instance, consider a scenario where you want to be notified whenever someone creates or updates an entry in Contentstack. In this case, you can set up a system that includes a webhook that triggers when a user creates or updates an entry. This webhook in turn must invoke a lambda function that notify a messaging service such as AWS SNS.

Set Up AWS Lambda action Connector

Perform the following steps to set up the AWS Lambda action connector:

  1. Click Configure Action Step from the left navigation panel.
  2. Click Action Step to configure third-party services.
  3. Within the Configure Action Step, click the AWS Lambda connector.
    Click to enlarge

  4. Under Choose an Action tab, select the Execute Lambda Function action.
    Click to enlarge
  5. Click + Add New Account to add your AWS account.
    Click to enlarge
  6. In the Authorize pop-up window, provide details such as Title, Access Key, Secret Key, and Region.
    Click to enlarge


    You can generate the Access and Secret Access Key by navigating through Security credentials > Access Keys > Create New Access Key in your AWS console.
    Click to enlarge

    Additional Resource For more information, refer to the Managing access keys for IAM users document.

  7. Once done, click Authorize.
  8. Click the Function Name textbox and select the required lambda function from the Lookup dropdown.

    NoteYou need to have your Lambda function defined in your AWS Services console before configuring your AWS Lambda action connector in Automations.


    Click to enlarge
  9. Click the Invocation Type textbox and select an option from the given dropdown. Here, you can choose from three options: Event, RequestResponse, and DryRun.
    1. Event: This returns a request ID and status code after successful execution of the function.
    2. RequestResponse: This returns a status code and a response message as body for the selected lambda function.
    3. DryRun: This allows you to test the function, and it returns a request ID and status code.
  10. Lets select Event as the invocation type for our first example, then we will cover other invocation types proceeding further.

    Click to enlarge
  11. [Optional] You can choose to add optional fields by clicking on the Show optional fields toggle. You will find two additional fields have appeared: Parameters and Specific Version or Tag.
  12. Click the Parameters textbox to add dynamic parameters to your Lambda function. Make sure to enter the parameter in JSON format only.
    You can also specify a Specific Version or Tag for your Lambda function.
    Click to enlarge
  13. Once done, click Proceed.
  14. Click Test Action to test the configured action connector.
    Click to enlarge
  15. After successful execution, you will get a Request ID and status code for your Lambda function. Click Save and Exit to finish the process.
    Click to enlarge

Now, in continuation to step 7 above, lets check out the output for the Invocation types RequestResponse and DryRun.

Invocation Type: RequestResponse
After performing steps 1-6 from above, perform the following steps:

  1. Select RequestResponse as the Invocation Type.
    Click to enlarge
  2. [Optional] Click the Show optional fields toggle.
    Add dynamic parameters (in JSON format) to your Lambda function under the Parameters textbox. And, specify a Specific Version or Tag for your Lambda function if need be.
    Click to enlarge


  3. Once done, click Proceed.
  4. Click Test Action to test the configured action connector.
    Click to enlarge


  5. After successful execution, you will get a status code and a response message (body) for your Lambda function. Click Save and Exit to finish setting up your connector.
    Click to enlarge

Invocation Type: DryRun
After performing steps 1-6 that we covered under setting up the Event invocation type, perform the following steps:

  1. Select DryRun as the Invocation Type.
    Click to enlarge
  2. [Optional] Click the Show optional fields toggle.
    Add dynamic parameters (in JSON format) to your Lambda function under the Parameters textbox. And, specify a Specific Version or Tag for your Lambda function if need be.
    Click to enlarge
  3. Once done, click Proceed.
  4. Click Test Action to test the configured action connector.
    Click to enlarge
  5. After successful execution, you will get a Request ID and status code for your Lambda function. Click Save and Exit to finish the process.
    Click to enlarge

This sets the AWS Lambda action connector.