aws.lambda.getInvocation
Explore with Pulumi AI
Invokes an AWS Lambda Function and returns its results. Use this data source to execute Lambda functions during Pulumi operations and use their results in other resources or outputs.
The Lambda function is invoked with RequestResponse invocation type.
Note: The
aws.lambda.Invocation
data source invokes the function during the firstapply
and every subsequentplan
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 a 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. (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.)
Example Usage
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>
def get_invocation(function_name: Optional[str] = None,
input: Optional[str] = None,
qualifier: Optional[str] = None,
region: 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,
region: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetInvocationResult]
func LookupInvocation(ctx *Context, args *LookupInvocationArgs, opts ...InvokeOption) (*LookupInvocationResult, error)
func LookupInvocationOutput(ctx *Context, args *LookupInvocationOutputArgs, opts ...InvokeOption) LookupInvocationResultOutput
> 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)
}
public static CompletableFuture<GetInvocationResult> getInvocation(GetInvocationArgs args, InvokeOptions options)
public static Output<GetInvocationResult> getInvocation(GetInvocationArgs args, InvokeOptions options)
fn::invoke:
function: aws:lambda/getInvocation:getInvocation
arguments:
# arguments dictionary
The following arguments are supported:
- Function
Name string - Name of the Lambda function.
- Input string
String in JSON format that is passed as payload to the Lambda function.
The following arguments are optional:
- Qualifier string
- Qualifier (a.k.a version) of the Lambda function. Defaults to
$LATEST
. - Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Function
Name string - Name of the Lambda function.
- Input string
String in JSON format that is passed as payload to the Lambda function.
The following arguments are optional:
- Qualifier string
- Qualifier (a.k.a version) of the Lambda function. Defaults to
$LATEST
. - Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- function
Name String - Name of the Lambda function.
- input String
String in JSON format that is passed as payload to the Lambda function.
The following arguments are optional:
- qualifier String
- Qualifier (a.k.a version) of the Lambda function. Defaults to
$LATEST
. - region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- function
Name string - Name of the Lambda function.
- input string
String in JSON format that is passed as payload to the Lambda function.
The following arguments are optional:
- qualifier string
- Qualifier (a.k.a version) of the Lambda function. Defaults to
$LATEST
. - region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- function_
name str - Name of the Lambda function.
- input str
String in JSON format that is passed as payload to the Lambda function.
The following arguments are optional:
- qualifier str
- Qualifier (a.k.a version) of the Lambda function. Defaults to
$LATEST
. - region str
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- function
Name String - Name of the Lambda function.
- input String
String in JSON format that is passed as payload to the Lambda function.
The following arguments are optional:
- qualifier String
- Qualifier (a.k.a version) of the Lambda function. Defaults to
$LATEST
. - region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
getInvocation Result
The following output properties are available:
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.