The Invoke Named Lambda Function Action is used to execute an existing named Lambda function in the selected Context.
This action ensures targeted execution of Lambda functions, not covered by GorillaStack's Actions. It's used to incorporate custom functionality to address specific requirements and automates workflows that involve Lambda functions. For example, you could use it to trigger a Lambda function to send an email notification when a new file is uploaded to S3, or to trigger a Lambda function to update a DynamoDB table when a new customer record is created.
As part of a sequence of Actions, you may wish to inject some custom code to handle a special requirement not handled by GorillaStack.
In the Action configuration, you first select your Lambda function by name.
Next, you can specify execution settings including the:
You can use the Action by setting up a rule.
You’ll also want to guarantee that you have created a Lambda function in the specified context that you can target by name.
There are two tabs used to configure the Action:
Function Name
The name of the function that you wish to target with this Action.
Invocation Type
This controls whether the Lambda function is invoked:
JSON Payload
You can pass a JSON payload along to your Lambda functions. GorillaStack also passes some Rule Execution data to your Lambda function, so that you can process information about the Context, Trigger and preceding Action results.
(See this specification on the schema of the JSON payload for more details.)
Environment Variables
With this setting, you can supplement or even optionally replace environment variables on your Lambda functions. Use this capability to inject configuration into your Lambda functions.
Specify your environment variables as key:value pairs, defining each variable’s name and value.
GorillaStack also provides a mechanism to set values as secrets. Selecting this checkbox
will mask the value and prevent it being read after the Rule is saved. While we provide
this to you, please be cautious of saving secrets in your Lambdas as environment
variables. These can be read from your Lambda functions in plain text by anyone with
privileges to view functions. Take a look for yourself aws lambda list-functions
. (See
AWS list-functions
docs for
more details.)