1. Packages
  2. AWS
  3. API Docs
  4. lambda
  5. getInvocation
AWS v6.77.0 published on Wednesday, Apr 9, 2025 by Pulumi

aws.lambda.getInvocation

Explore with Pulumi AI

AWS v6.77.0 published on Wednesday, Apr 9, 2025 by Pulumi

Use this data source to invoke custom lambda functions as data source. The lambda function is invoked with RequestResponse invocation type.

NOTE: The aws.lambda.Invocation data source invokes the function during the first apply and every subsequent plan when the function is known.

NOTE: If you get a KMSAccessDeniedException: Lambda was unable to decrypt the environment variables because KMS access was denied error when invoking an aws.lambda.Function with environment variables, the IAM role associated with the function may have been deleted and recreated after the function was created. You can fix the problem two ways: 1) updating the function’s role to another role and then updating it back again to the recreated role, or 2) by using Pulumi to taint the function and apply your configuration again to recreate the function. (When you create a function, Lambda grants permissions on the KMS key to the function’s IAM role. If the IAM role is recreated, the grant is no longer valid. Changing the function’s role or recreating the function causes Lambda to update the grant.)

Using getInvocation

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getInvocation(args: GetInvocationArgs, opts?: InvokeOptions): Promise<GetInvocationResult>
function getInvocationOutput(args: GetInvocationOutputArgs, opts?: InvokeOptions): Output<GetInvocationResult>
Copy
def get_invocation(function_name: Optional[str] = None,
                   input: Optional[str] = None,
                   qualifier: Optional[str] = None,
                   opts: Optional[InvokeOptions] = None) -> GetInvocationResult
def get_invocation_output(function_name: Optional[pulumi.Input[str]] = None,
                   input: Optional[pulumi.Input[str]] = None,
                   qualifier: Optional[pulumi.Input[str]] = None,
                   opts: Optional[InvokeOptions] = None) -> Output[GetInvocationResult]
Copy
func LookupInvocation(ctx *Context, args *LookupInvocationArgs, opts ...InvokeOption) (*LookupInvocationResult, error)
func LookupInvocationOutput(ctx *Context, args *LookupInvocationOutputArgs, opts ...InvokeOption) LookupInvocationResultOutput
Copy

> Note: This function is named LookupInvocation in the Go SDK.

public static class GetInvocation 
{
    public static Task<GetInvocationResult> InvokeAsync(GetInvocationArgs args, InvokeOptions? opts = null)
    public static Output<GetInvocationResult> Invoke(GetInvocationInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetInvocationResult> getInvocation(GetInvocationArgs args, InvokeOptions options)
public static Output<GetInvocationResult> getInvocation(GetInvocationArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: aws:lambda/getInvocation:getInvocation
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

FunctionName This property is required. string
Name of the lambda function.
Input This property is required. string
String in JSON format that is passed as payload to the lambda function.
Qualifier string
Qualifier (a.k.a version) of the lambda function. Defaults to $LATEST.
FunctionName This property is required. string
Name of the lambda function.
Input This property is required. string
String in JSON format that is passed as payload to the lambda function.
Qualifier string
Qualifier (a.k.a version) of the lambda function. Defaults to $LATEST.
functionName This property is required. String
Name of the lambda function.
input This property is required. String
String in JSON format that is passed as payload to the lambda function.
qualifier String
Qualifier (a.k.a version) of the lambda function. Defaults to $LATEST.
functionName This property is required. string
Name of the lambda function.
input This property is required. string
String in JSON format that is passed as payload to the lambda function.
qualifier string
Qualifier (a.k.a version) of the lambda function. Defaults to $LATEST.
function_name This property is required. str
Name of the lambda function.
input This property is required. str
String in JSON format that is passed as payload to the lambda function.
qualifier str
Qualifier (a.k.a version) of the lambda function. Defaults to $LATEST.
functionName This property is required. String
Name of the lambda function.
input This property is required. String
String in JSON format that is passed as payload to the lambda function.
qualifier String
Qualifier (a.k.a version) of the lambda function. Defaults to $LATEST.

getInvocation Result

The following output properties are available:

FunctionName string
Id string
The provider-assigned unique ID for this managed resource.
Input string
Result string
String result of the lambda function invocation.
Qualifier string
FunctionName string
Id string
The provider-assigned unique ID for this managed resource.
Input string
Result string
String result of the lambda function invocation.
Qualifier string
functionName String
id String
The provider-assigned unique ID for this managed resource.
input String
result String
String result of the lambda function invocation.
qualifier String
functionName string
id string
The provider-assigned unique ID for this managed resource.
input string
result string
String result of the lambda function invocation.
qualifier string
function_name str
id str
The provider-assigned unique ID for this managed resource.
input str
result str
String result of the lambda function invocation.
qualifier str
functionName String
id String
The provider-assigned unique ID for this managed resource.
input String
result String
String result of the lambda function invocation.
qualifier String

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.
AWS v6.77.0 published on Wednesday, Apr 9, 2025 by Pulumi