Configure your Lambda functions to stream response payloads back to clients. For more information, see Configuring a Lambda function to stream responses.
This operation requires permission for the lambda:InvokeFunction action. For details on how to set up permissions for cross-account invocations, see Granting function access to other accounts.
Request SyntaxPOST /2021-11-15/functions/FunctionName
/response-streaming-invocations?Qualifier=Qualifier
HTTP/1.1
X-Amz-Invocation-Type: InvocationType
X-Amz-Log-Type: LogType
X-Amz-Client-Context: ClientContext
Payload
URI Request Parameters
The request uses the following URI parameters.
Up to 3,583 bytes of base64-encoded data about the invoking client to pass to the function in the context object.
The name or ARN of the Lambda function.
Name formatsFunction name â my-function
.
Function ARN â arn:aws:lambda:us-west-2:123456789012:function:my-function
.
Partial ARN â 123456789012:function:my-function
.
The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
Length Constraints: Minimum length of 1. Maximum length of 170.
Pattern: (arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}(-gov)?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_\.]+)(:(\$LATEST|[a-zA-Z0-9-_]+))?
Required: Yes
Use one of the following options:
RequestResponse
(default) â Invoke the function synchronously. Keep the connection open until the function returns a response or times out. The API operation response includes the function response and additional data.
DryRun
â Validate parameter values and verify that the IAM user or role has permission to invoke the function.
Valid Values: RequestResponse | DryRun
Set to Tail
to include the execution log in the response. Applies to synchronously invoked functions only.
Valid Values: None | Tail
The alias name.
Length Constraints: Minimum length of 1. Maximum length of 128.
Pattern: (|[a-zA-Z0-9$_-]+)
The request accepts the following binary data.
The JSON that you want to provide to your Lambda function as input.
You can enter the JSON directly. For example, --payload '{ "key": "value" }'
. You can also specify a file path. For example, --payload file://payload.json
.
HTTP/1.1 StatusCode
X-Amz-Executed-Version: ExecutedVersion
Content-Type: ResponseStreamContentType
Content-type: application/json
{
"InvokeComplete": {
"ErrorCode": "string",
"ErrorDetails": "string",
"LogResult": "string"
},
"PayloadChunk": {
"Payload": blob
}
}
Response Elements
If the action is successful, the service sends back the following HTTP response.
For a successful request, the HTTP status code is in the 200 range. For the RequestResponse
invocation type, this status code is 200. For the DryRun
invocation type, this status code is 204.
The response returns the following HTTP headers.
The version of the function that executed. When you invoke a function with an alias, this indicates which version the alias resolved to.
Length Constraints: Minimum length of 1. Maximum length of 1024.
Pattern: (\$LATEST|[0-9]+)
The type of data the stream is returning.
The following data is returned in JSON format by the service.
ErrorsFor information about the errors that are common to all actions, see Common Errors.
Need additional permissions to configure VPC settings.
HTTP Status Code: 502
Amazon EC2 throttled AWS Lambda during Lambda function initialization using the execution role provided for the function.
HTTP Status Code: 502
AWS Lambda received an unexpected Amazon EC2 client exception while setting up for the Lambda function.
HTTP Status Code: 502
An error occurred when reading from or writing to a connected file system.
HTTP Status Code: 410
The Lambda function couldn't make a network connection to the configured file system.
HTTP Status Code: 408
The Lambda function couldn't mount the configured file system due to a permission or configuration issue.
HTTP Status Code: 403
The Lambda function made a network connection to the configured file system, but the mount operation timed out.
HTTP Status Code: 408
AWS Lambda couldn't create an elastic network interface in the VPC, specified as part of Lambda function configuration, because the limit for network interfaces has been reached. For more information, see Lambda quotas.
HTTP Status Code: 502
One of the parameters in the request is not valid.
HTTP Status Code: 400
The request body could not be parsed as JSON, or a request header is invalid. For example, the 'x-amzn-RequestId' header is not a valid UUID string.
HTTP Status Code: 400
The runtime or runtime version specified is not supported.
HTTP Status Code: 502
The security group ID provided in the Lambda function VPC configuration is not valid.
HTTP Status Code: 502
The subnet ID provided in the Lambda function VPC configuration is not valid.
HTTP Status Code: 502
AWS Lambda could not unzip the deployment package.
HTTP Status Code: 502
Lambda couldn't decrypt the environment variables because AWS KMS access was denied. Check the Lambda function's KMS permissions.
HTTP Status Code: 502
Lambda couldn't decrypt the environment variables because the AWS KMS key used is disabled. Check the Lambda function's KMS key settings.
HTTP Status Code: 502
Lambda couldn't decrypt the environment variables because the state of the AWS KMS key used is not valid for Decrypt. Check the function's KMS key settings.
HTTP Status Code: 502
Lambda couldn't decrypt the environment variables because the AWS KMS key was not found. Check the function's KMS key settings.
HTTP Status Code: 502
Lambda has detected your function being invoked in a recursive loop with other AWS resources and stopped your function's invocation.
HTTP Status Code: 400
The request payload exceeded the Invoke
request body JSON input quota. For more information, see Lambda quotas.
HTTP Status Code: 413
The resource already exists, or another operation is in progress.
HTTP Status Code: 409
The resource specified in the request does not exist.
HTTP Status Code: 404
The function is inactive and its VPC connection is no longer available. Wait for the VPC connection to reestablish and try again.
HTTP Status Code: 502
The AWS Lambda service encountered an internal error.
HTTP Status Code: 500
The afterRestore()
runtime hook encountered an error. For more information, check the Amazon CloudWatch logs.
HTTP Status Code: 400
Lambda is initializing your function. You can invoke the function when the function state becomes Active
.
HTTP Status Code: 409
Lambda couldn't restore the snapshot within the timeout limit.
HTTP Status Code: 408
AWS Lambda couldn't set up VPC access for the Lambda function because one or more configured subnets has no available IP addresses.
HTTP Status Code: 502
The request throughput limit was exceeded. For more information, see Lambda quotas.
HTTP Status Code: 429
The content type of the Invoke
request body is not JSON.
HTTP Status Code: 415
For more information about using this API in one of the language-specific AWS SDKs, see the following:
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4