Light Dark

Functions

invoke

fn (function_name: Str, payload: Any, invocation_type: Str, log_type: Str): InvokeResponse | AwsError
fn (function_name: Str, payload: Any, invocation_type: Str): InvokeResponse | AwsError
fn (function_name: Str, payload: Any): InvokeResponse | AwsError
fn (function_name: Str): InvokeResponse | AwsError

Invoke a Lambda function synchronously.

Example

// Invoke with no payload
result ::aws::lambda::invoke/invoke("my-function")
result.status_code  // => 200
result.payload      // => "Hello from Lambda!"

// Invoke with payload
result ::aws::lambda::invoke/invoke("my-function", {name: "Hot", test: true})
result.status_code  // => 200
result.payload      // => {message: "Hello, Hot!"}

invoke-async

fn (function_name: Str, payload: Any): InvokeResponse | AwsError
fn (function_name: Str): InvokeResponse | AwsError

Invoke a Lambda function asynchronously (fire and forget).

The function is invoked and returns immediately without waiting for the result. Returns status code 202 (Accepted) on success.

Example

result ::aws::lambda::invoke/invoke-async("my-function", {event: "process"})
result.status_code  // => 202

invoke-dry-run

fn (function_name: Str, payload: Any): InvokeResponse | AwsError
fn (function_name: Str): InvokeResponse | AwsError

Validate a Lambda invocation without actually executing the function.

Returns status code 204 (No Content) if the function exists and permissions are valid.

Example

result ::aws::lambda::invoke/invoke-dry-run("my-function")
result.status_code  // => 204

invoke-with-logs

fn (function_name: Str, payload: Any): InvokeResponse | AwsError
fn (function_name: Str): InvokeResponse | AwsError

Invoke a Lambda function and include base64-encoded logs in the response.

Example

result ::aws::lambda::invoke/invoke-with-logs("my-function")
result.status_code  // => 200
result.payload      // => "Hello from Lambda!"
result.log_result   // => base64-encoded execution logs

Types

InvokeResponse

InvokeResponse type {
    status_code: Int?,
    function_error: Str?,
    log_result: Str?,
    payload: Any,
    executed_version: Str?
}