---
title: "Create a AwsLambda plugin"
method: POST
path: "/{workspace}/plugins#AwsLambda"
tags: ["Plugins"]
---

# Create a AwsLambda plugin

`POST /{workspace}/plugins#AwsLambda`

Create a AwsLambda plugin

## Request body

- AwsLambdaPlugin — A Plugin entity represents a plugin configuration that will be executed during the HTTP request/response lifecycle. It is how you can add functionalities to Services that run behind Kong, like Authentication or Rate Limiting for example. You can find more information about how to install and what values each plugin takes by visiting the [Kong Hub](https://docs.konghq.com/hub/). When adding a Plugin Configuration to a Service, every request made by a client to that Service will run said Plugin. If a Plugin needs to be tuned to different values for some specific Consumers, you can do so by creating a separate plugin instance that specifies both the Service and the Consumer, through the `service` and `consumer` fields.
  - `condition` string, nullable — An expression used for conditional control over plugin execution. If the expression evaluates to `true` during the request flow, the plugin is executed; otherwise, it is skipped.
  - `created_at` integer, nullable — Unix epoch when the resource was created.
  - `enabled` boolean, nullable — Whether the plugin is applied.
  - `id` string, nullable — A string representing a UUID (universally unique identifier).
  - `instance_name` string, nullable — A unique string representing a UTF-8 encoded name.
  - `name` 'aws-lambda', required — The name of the Plugin that's going to be added. Currently, the Plugin must be installed in every Kong instance separately.
  - `ordering` object, nullable
    - `after` object
      - `access` string[]
    - `before` object
      - `access` string[]
  - `partials` object[] — A list of partials to be used by the plugin.
    - `id` string — A string representing a UUID (universally unique identifier).
    - `name` string — A unique string representing a UTF-8 encoded name.
    - `path` string
  - `tags` string[], nullable — An optional set of strings associated with the Plugin for grouping and filtering.
  - `updated_at` integer, nullable — Unix epoch when the resource was last updated.
  - `config` object
    - `aws_assume_role_arn` string — The target AWS IAM role ARN used to invoke the Lambda function.
    - `aws_imds_protocol_version` 'v1' | 'v2' — Identifier to select the IMDS protocol version to use: `v1` or `v2`.
    - `aws_key` string — The AWS key credential to be used when invoking the function.
    - `aws_region` string — A string representing a host name, such as example.com.
    - `aws_role_session_name` string — The identifier of the assumed role session.
    - `aws_secret` string — The AWS secret credential to be used when invoking the function.
    - `aws_sts_endpoint_url` string — A string representing a URL, such as https://example.com/path/to/resource?q=search.
    - `awsgateway_compatible` boolean — An optional value that defines whether the plugin should wrap requests into the Amazon API gateway.
    - `awsgateway_compatible_payload_version` '1.0' | '2.0' — An optional value that defines which version will be used to generate the AWS API Gateway compatible payload. The default will be `1.0`.
    - `base64_encode_body` boolean — An optional value that Base64-encodes the request body.
    - `disable_https` boolean
    - `empty_arrays_mode` 'correct' | 'legacy' — An optional value that defines whether Kong should send empty arrays (returned by Lambda function) as `[]` arrays or `{}` objects in JSON responses. The value `legacy` means Kong will send empty arrays as `{}` objects in response
    - `forward_request_body` boolean — An optional value that defines whether the request body is sent in the request_body field of the JSON-encoded request. If the body arguments can be parsed, they are sent in the separate request_body_args field of the request.
    - `forward_request_headers` boolean — An optional value that defines whether the original HTTP request headers are sent as a map in the request_headers field of the JSON-encoded request.
    - `forward_request_method` boolean — An optional value that defines whether the original HTTP request method verb is sent in the request_method field of the JSON-encoded request.
    - `forward_request_uri` boolean — An optional value that defines whether the original HTTP request URI is sent in the request_uri field of the JSON-encoded request.
    - `function_name` string — The AWS Lambda function to invoke. Both function name and function ARN (including partial) are supported.
    - `host` string — A string representing a host name, such as example.com.
    - `invocation_type` 'DryRun' | 'Event' | 'RequestResponse' — The InvocationType to use when invoking the function. Available types are RequestResponse, Event, DryRun.
    - `is_proxy_integration` boolean — An optional value that defines whether the response format to receive from the Lambda to this format.
    - `keepalive` number — An optional value in milliseconds that defines how long an idle connection lives before being closed.
    - `log_type` 'None' | 'Tail' — The LogType to use when invoking the function. By default, None and Tail are supported.
    - `port` integer — An integer representing a port number between 0 and 65535, inclusive.
    - `preserve_lambda_api_error_code` boolean — When enabled, the HTTP status code returned by the AWS Lambda API is forwarded to the client instead of mapping all errors to HTTP 500. Applies to 4xx and 5xx responses from the Lambda API.
    - `proxy_url` string — A string representing a URL, such as https://example.com/path/to/resource?q=search.
    - `qualifier` string — The qualifier to use when invoking the function.
    - `skip_large_bodies` boolean — An optional value that defines whether Kong should send large bodies that are buffered to disk
    - `ssl_verify` boolean — Set to `true` to verify the TLS certificate when connecting to AWS services.
    - `timeout` number — An optional timeout in milliseconds when invoking the function.
    - `unhandled_status` integer — The response status code to use (instead of the default 200, 202, or 204) in the case of an Unhandled Function Error.
  - `consumer` object — If set, the plugin will activate only for requests where the specified has been authenticated. (Note that some plugins can not be restricted to consumers this way.). Leave unset for the plugin to activate regardless of the authenticated Consumer.
    - `id` string
  - `protocols` string[] — A set of strings representing HTTP protocols.
  - `route` object — If set, the plugin will only activate when receiving requests via the specified route. Leave unset for the plugin to activate regardless of the route being used.
    - `id` string
  - `service` object — If set, the plugin will only activate when receiving requests via one of the routes belonging to the specified Service. Leave unset for the plugin to activate regardless of the Service being matched.
    - `id` string

## Response `201`

Created AwsLambda plugin

- AwsLambdaPlugin — A Plugin entity represents a plugin configuration that will be executed during the HTTP request/response lifecycle. It is how you can add functionalities to Services that run behind Kong, like Authentication or Rate Limiting for example. You can find more information about how to install and what values each plugin takes by visiting the [Kong Hub](https://docs.konghq.com/hub/). When adding a Plugin Configuration to a Service, every request made by a client to that Service will run said Plugin. If a Plugin needs to be tuned to different values for some specific Consumers, you can do so by creating a separate plugin instance that specifies both the Service and the Consumer, through the `service` and `consumer` fields.
  - `condition` string, nullable — An expression used for conditional control over plugin execution. If the expression evaluates to `true` during the request flow, the plugin is executed; otherwise, it is skipped.
  - `created_at` integer, nullable — Unix epoch when the resource was created.
  - `enabled` boolean, nullable — Whether the plugin is applied.
  - `id` string, nullable — A string representing a UUID (universally unique identifier).
  - `instance_name` string, nullable — A unique string representing a UTF-8 encoded name.
  - `name` 'aws-lambda', required — The name of the Plugin that's going to be added. Currently, the Plugin must be installed in every Kong instance separately.
  - `ordering` object, nullable
    - `after` object
      - `access` string[]
    - `before` object
      - `access` string[]
  - `partials` object[] — A list of partials to be used by the plugin.
    - `id` string — A string representing a UUID (universally unique identifier).
    - `name` string — A unique string representing a UTF-8 encoded name.
    - `path` string
  - `tags` string[], nullable — An optional set of strings associated with the Plugin for grouping and filtering.
  - `updated_at` integer, nullable — Unix epoch when the resource was last updated.
  - `config` object
    - `aws_assume_role_arn` string — The target AWS IAM role ARN used to invoke the Lambda function.
    - `aws_imds_protocol_version` 'v1' | 'v2' — Identifier to select the IMDS protocol version to use: `v1` or `v2`.
    - `aws_key` string — The AWS key credential to be used when invoking the function.
    - `aws_region` string — A string representing a host name, such as example.com.
    - `aws_role_session_name` string — The identifier of the assumed role session.
    - `aws_secret` string — The AWS secret credential to be used when invoking the function.
    - `aws_sts_endpoint_url` string — A string representing a URL, such as https://example.com/path/to/resource?q=search.
    - `awsgateway_compatible` boolean — An optional value that defines whether the plugin should wrap requests into the Amazon API gateway.
    - `awsgateway_compatible_payload_version` '1.0' | '2.0' — An optional value that defines which version will be used to generate the AWS API Gateway compatible payload. The default will be `1.0`.
    - `base64_encode_body` boolean — An optional value that Base64-encodes the request body.
    - `disable_https` boolean
    - `empty_arrays_mode` 'correct' | 'legacy' — An optional value that defines whether Kong should send empty arrays (returned by Lambda function) as `[]` arrays or `{}` objects in JSON responses. The value `legacy` means Kong will send empty arrays as `{}` objects in response
    - `forward_request_body` boolean — An optional value that defines whether the request body is sent in the request_body field of the JSON-encoded request. If the body arguments can be parsed, they are sent in the separate request_body_args field of the request.
    - `forward_request_headers` boolean — An optional value that defines whether the original HTTP request headers are sent as a map in the request_headers field of the JSON-encoded request.
    - `forward_request_method` boolean — An optional value that defines whether the original HTTP request method verb is sent in the request_method field of the JSON-encoded request.
    - `forward_request_uri` boolean — An optional value that defines whether the original HTTP request URI is sent in the request_uri field of the JSON-encoded request.
    - `function_name` string — The AWS Lambda function to invoke. Both function name and function ARN (including partial) are supported.
    - `host` string — A string representing a host name, such as example.com.
    - `invocation_type` 'DryRun' | 'Event' | 'RequestResponse' — The InvocationType to use when invoking the function. Available types are RequestResponse, Event, DryRun.
    - `is_proxy_integration` boolean — An optional value that defines whether the response format to receive from the Lambda to this format.
    - `keepalive` number — An optional value in milliseconds that defines how long an idle connection lives before being closed.
    - `log_type` 'None' | 'Tail' — The LogType to use when invoking the function. By default, None and Tail are supported.
    - `port` integer — An integer representing a port number between 0 and 65535, inclusive.
    - `preserve_lambda_api_error_code` boolean — When enabled, the HTTP status code returned by the AWS Lambda API is forwarded to the client instead of mapping all errors to HTTP 500. Applies to 4xx and 5xx responses from the Lambda API.
    - `proxy_url` string — A string representing a URL, such as https://example.com/path/to/resource?q=search.
    - `qualifier` string — The qualifier to use when invoking the function.
    - `skip_large_bodies` boolean — An optional value that defines whether Kong should send large bodies that are buffered to disk
    - `ssl_verify` boolean — Set to `true` to verify the TLS certificate when connecting to AWS services.
    - `timeout` number — An optional timeout in milliseconds when invoking the function.
    - `unhandled_status` integer — The response status code to use (instead of the default 200, 202, or 204) in the case of an Unhandled Function Error.
  - `consumer` object — If set, the plugin will activate only for requests where the specified has been authenticated. (Note that some plugins can not be restricted to consumers this way.). Leave unset for the plugin to activate regardless of the authenticated Consumer.
    - `id` string
  - `protocols` string[] — A set of strings representing HTTP protocols.
  - `route` object — If set, the plugin will only activate when receiving requests via the specified route. Leave unset for the plugin to activate regardless of the route being used.
    - `id` string
  - `service` object — If set, the plugin will only activate when receiving requests via one of the routes belonging to the specified Service. Leave unset for the plugin to activate regardless of the Service being matched.
    - `id` string

## Other responses

- `401` — Unauthorized

---

[API](https://skmtc.net/kong/apis/kong-enterprise-admin-api.md) · [All operations](https://skmtc.net/kong/apis/kong-enterprise-admin-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/kong/kong-enterprise-admin-api/revisions/28b1f8a59cdc/schema)
