You're viewing **Apigee Edge** documentation.  
[Go to the
**Apigee X** documentation](http://cloud.google.com/apigee/docs). info


> [!NOTE]
> **Note:** Apigee Extensions are available in the Edge UI to Google Cloud Apigee customers with an Enterprise [support](https://cloud.google.com/apigee/pricing) plan.

> [!NOTE]
> **Note:** Extensions marked as deprecated will no longer be available for selection by users. However, the currently deployed version(s) will remain unaffected.

> [!CAUTION]
> **Caution:** This version of the extension is no longer supported and has been deprecated.

<br />

> Version: 1.1.1

Execute functions deployed on AWS Lambda. Use this extension to list the functions available in your AWS account, then invoke specific functions.

> [!NOTE]
> **Note:** A key benefit of this extension is its handling of authentication. If access to your AWS Lambda function doesn't require authentication, considering invoking the function using the [ServiceCallout policy](https://docs.apigee.com/api-platform/reference/policies/service-callout-policy).

## Prerequisites

Before using the extension from an API proxy using the [ExtensionCallout policy](https://docs.apigee.com/api-platform/reference/policies/extension-callout-policy), you must:

- Get your Amazon [access key ID and secret access key](https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys).

  You'll need these, along with the name of the region where your functions are deployed, to [configure](https://docs.apigee.com/api-platform/reference/extensions/aws-lambda/aws-lambda-extension-111#configuration_reference) this extension.
- Deploy your Lambda function. For the extension to be able to access a Lambda function, it must either be:

  - Deployed in a public VPC
  - Deployed in a private VPC with public NAT gateway

  See [Configuring a Lambda Function to Access Resources in an Amazon VPC](https://docs.aws.amazon.com/lambda/latest/dg/vpc.html) for more.

## About AWS Lambda

[AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/welcome.html) provides compute environments where you can execute functions in one of the supported languages.

## Actions


> [!NOTE]
> **Note:** See the [ExtensionCallout policy](https://docs.apigee.com/api-platform/reference/policies/extension-callout-policy) for more information on setting [`<Action>`](https://docs.apigee.com/api-platform/reference/policies/extension-callout-policy#action_element), [`<Input>`](https://docs.apigee.com/api-platform/reference/policies/extension-callout-policy#input_element), and [`<Output>`](https://docs.apigee.com/api-platform/reference/policies/extension-callout-policy#output_element).

<br />

### invoke

Invokes a function on AWS Lambda.

For more detail about parameters, see the [AWS Lambda Invoke documentation](https://docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html).

### Syntax

    <Action>invoke</Action>
    <Input><![CDATA[
    {
      "functionName" : "function-on-lambda",
      "invocationType" : "RequestResponse | Event | DryRun",
      "logType" : "None | Tail",
      "qualifier" : "Version-or-alias",
      "payload" : "Escaped-JSON-string"
    }
    ]]>
    </Input>
    <Output>flow-variable</Output>

### Example

    <Action>invoke</Action>
    <Input><![CDATA[
    {
      "functionName" : "helloWorld",
      "invocationType" : "RequestResponse",
      "logType" : "None",
      "qualifier" : "$LATEST",
      "payload" : "{ \"key\": \"val\" }"
    }
    ]]>
    </Input>
    <Output>function.response.value</Output>

#### Request parameters

For more detail about parameters, see the [AWS Lambda Invoke documentation](https://docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html).

| Parameter | Description | Type | Default | Required |
|---|---|---|---|---|
| functionName | The name of the function to invoke. | String. | None. | Yes. |
| invocationType | Specifies whether to invoke the function synchronously, asynchronously, or validate parameter values. | String. | None. | No. |
| logType | Optionally specifies whether to return the last 4 KB of log data. | String | None. | No. |
| qualifier | The version of alias of a published Lambda function. | String | None. | No. |
| payload | JSON as input to the Lambda function. | String | None. | No. |

#### Response

An array of functions containing specific version details. The following is an example:

    {
      "StatusCode" : 200,
      "Payload" : "{\"statusCode\":200,\"body\":\"\\\"Hello World!\\\"\"}"
    }

#### Response properties

| Property | Description | Type | Default |
|---|---|---|---|
| StatusCode | HTTP status code. | Integer | None. |
| Payload | JSON representing the object returned by the function. Present only if the invocation type is RequestResponse. For a function error, this contains an error description message. | String | None. |

### listFunctions

Lists the available AWS Lambda functions.

For more detail about parameters, see the [AWS Lambda ListFunctions documentation](https://docs.aws.amazon.com/lambda/latest/dg/API_ListFunctions.html).

### Syntax

    <Action>listFunctions</Action>
    <Input><![CDATA[
    {
      "masterRegion" : "ALL | [a-z]{2}(-gov)?-[a-z]+-\d{1}",
      "functionVersion" : "ALL",
      "maxItems" : 1 - 10000
    }
    ]]>
    </Input>
    <Output>flow-variable</Output>

### Example

    <Action>listFunctions</Action>
    <Input><![CDATA[
    {
      "masterRegion" : "ALL",
      "functionVersion" : "ALL",
      "maxItems" : 50
    }
    ]]>
    </Input>
    <Output>function.list</Output>

#### Request parameters

For more detail about parameters, see the [AWS Lambda ListFunctions documentation](https://docs.aws.amazon.com/lambda/latest/dg/API_ListFunctions.html).

| Parameter | Description | Type | Default | Required |
|---|---|---|---|---|
| masterRegion | The region (such as `us-east-2`) whose functions should be listed; `ALL` to include functions from any region. If specified, you also must specify the `functionVersion`. | String | None. | No. |
| functionVersion | Specify `ALL` to list all published versions. If not specified, only the latest unpublished version ARN is returned. | String | None. | No. |
| maxItems | The maximum number of functions to return in response. Must be greater than 0. The absolute maximum that can be returned is 50. | Integer | None. | No. |

#### Response

JSON representing an array of functions containing specific version details.

    [
      {
        "FunctionName": "helloWorld",
        "FunctionArn": "arn:aws:lambda:fake-region:012345:function:helloWorld",
        "Runtime": "nodejs",
        "Role": "arn:aws:iam::012345:role/service-role/fakeRole",
        "Handler": "index.handler",
        "Description": "A Hello World lambda function.",
        "Version": "$LATEST"
      },
      {
        "FunctionName": "helloWorld",
        "FunctionArn": "arn:aws:lambda:fake-region:012345:function:helloWorld",
        "Runtime": "nodejs",
        "Role": "arn:aws:iam::012345:role/service-role/fakeRole",
        "Handler": "index.handler",
        "Description": "A Hello World lambda function.",
        "Version": "1"
      }
    ]

#### Response properties

| Property | Description | Type | Default |
|---|---|---|---|
| Description | A description of the function. | String. | None. |
| Handler | The function that Lambda calls to begin executing the function. | String. | None. |
| FunctionArn | The function's Amazon Resource Name. | String. | None. |
| FunctionName | The name of the function. | String. | None. |
| Role | The function's execution role. | String. | None. |
| Runtime | The function's runtime environment. | String. | None. |
| Version | The function's version. | String. | None. |

## Configuration Reference

Use the following when you're configuring and deploying this extension for use in API proxies. For steps to configure an extension using the Apigee console, see [Adding and configuring an extension](https://docs.apigee.com/api-platform/extensions/configuring-an-extension).

> [!NOTE]
> **Note:** The ability to configure and deploy extensions is available only to organization administrators.

### Common extension properties

The following properties are present for every extension.

| Property | Description | Default | Required |
|---|---|---|---|
| `name` | Name you're giving this configuration of the extension. | None | Yes |
| `packageName` | Name of the extension package as given by Apigee Edge. | None | Yes |
| `version` | Version number for the extension package from which you're configuring an extension. | None | Yes |
| `configuration` | Configuration value specific to the extension you're adding. See [Properties for this extension package](https://docs.apigee.com/api-platform/reference/extensions/aws-lambda/aws-lambda-extension-111#properties_for_this_extension_package) | None | Yes |

### Properties for this extension package

Specify values for the following configuration properties specific to this extension.

| Property | Description | Default | Required |
|---|---|---|---|
| AWS Lambda Region | The name of the region where your functions are deployed. For example: `us-east-1`. | None. | Yes. |
| Credentials | When entered in the Apigee Edge console, this is a JSON file containing your Amazon access key ID and access key in the following form: `{` `"accessKeyId" : "access-key-ID",` `"secretAccessKey" : "secret-access-key"` `}` When sent via the management API, it is a base64-encoded value generated from that key JSON file. | None. | Yes. |