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 the Contentstack.

Note: You need to define the Lambda function in your AWS Services console before configuring it to 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. In the Configure Action window, select the AWS Lambda action connector.
    Select-COnnector.png
  2. Select the Execute Lambda Function action.
    Select-An-Action.png
  3. Click on + Add New Account to add your AWS account.
    Add-An-Account.png
  4. In the Authorize pop-up window, provide details such as Title, Access Key, Secret Access Key, and Region.
    Click-Authorize.png
    You can generate the Access and Secret Access Key by navigating through Security credentials > Access Keys > Create New Access Key in your AWS console.
    5.Generate_Access_Key.png

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

  5. Once done, click on Authorize.
  6. Click on the Function Name textbox and select the required lambda function from the LOOKUP drop-down.

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

    Select-Function-Name.png
  7. Click on the Invocation Type textbox and select an option from the given drop-down. 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.

    Let’s select Event as the invocation type for our first example, then we will cover other invocation types proceeding further.

    Select-Event.png

  8. [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.
  9. Click on 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.
    Event-Parameter.png
  10. Once done, click on Proceed.
  11. Click on Test Action to test the configured action connector.
    Test-Action.png
  12. After successful execution, you will get a Request ID and status code for your Lambda function. Click on Save and Exit to finish the process.
    Save-Exit.png

Now, in continuation to step 7 above, let’s 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.
    Request-Response-Event.png
  2. [Optional] Click on 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.
    Request-Response-Parameters.png
  3. Once done, click on Proceed.
  4. Click on Test Action to test the configured action connector.
    Test-Action-Requestresponse.png
  5. After successful execution, you will get a status code and a response message (body) for your Lambda function. Click on Save and Exit to finish setting up your connector.
    Save-Exit-Request-Response.png

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.
    DryRun-Event.png
  2. [Optional] Click on 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.
    DryRun-Parameteres.png
  3. Once done, click on Proceed.
  4. Click on Test Action to test the configured action connector.
    Test-Action-DryRun.png
  5. After successful execution, you will get a Request ID and status code for your Lambda function. Click on Save and Exit to finish the process.
    Save-Exit-DryRun.png

This sets the AWS Lambda action connector.

Was this article helpful?

Thanks for your feedbackSmile-icon

On This Page

^