Invoke Tagged Lambda Functions

Overview

The Invoke Tagged Lambda Functions Action is used to execute existing Lambda functions in the selected Context with AWS resource tags that match a set of GorillaStack Tag Groups.

It is a way to centrally manage the execution of Lambda functions based on their tags. As an example, you could use the Invoke Tagged Lambda Functions Action to invoke all Lambda functions with the Tag Group "Environment:Production" when you deploy a new version of your application.

Use of this action in a rule

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, select one or more Tag Groups that should be used to compare against the resource tags on your existing Lambda Functions.

Next, you can specify execution settings including the:

  • Invocation Type (synchronous or asynchronous)
  • JSON Payload
  • Environment Variables

Getting Started

You can use the Action by setting up a rule.

You’ll need to have set up one or more Tag Groups. They are used to choose which Lambda function should be executed out all the Lambda functions that exist in the Context selected for the Rule.

(See the user guide on Tag Groups for more details.)

Action Configuration

There are two tabs used to configure the Action:

  • Targeting - select the Tag Groups to select the right Lambda functions for execution.
  • Settings - select options that control how your Lambda functions should be executed.

Targeting

Tag Groups

This is the set of Tag Groups used to target your Lambda functions. You can combine multiple tag groups with an AND relationship (all tag groups must match each Lambda) or an OR relationship (one or more of the tag groups must match each Lambda).

Settings

Invocation Type

This controls whether the Lambda function is invoked:

  • Synchronously - Lambda runs the function and waits for a response. Within a sequence of Actions, GorillaStack will wait for all targeted Lambda functions to complete before continuing with the next Action in the sequence. (See AWS Lambda Docs for more details.)
  • Asynchronously - Lambda queues the event and a separate process will execute the function. The success response indicates that the event has been received, not that the function has yet executed. Your GorillaStack Action could complete before the function finishes, or even starts running. (See AWS Lambda Docs for more details.)

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.)