UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

89 lines (88 loc) 4.69 kB
import * as pulumi from "@pulumi/pulumi"; /** * 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](https://docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html#API_Invoke_RequestSyntax) 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 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 */ export declare function getInvocation(args: GetInvocationArgs, opts?: pulumi.InvokeOptions): Promise<GetInvocationResult>; /** * A collection of arguments for invoking getInvocation. */ export interface GetInvocationArgs { /** * Name of the Lambda function. */ functionName: string; /** * String in JSON format that is passed as payload to the Lambda function. * * The following arguments are optional: */ input: string; /** * Qualifier (a.k.a version) of the Lambda function. Defaults to `$LATEST`. */ qualifier?: string; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: string; } /** * A collection of values returned by getInvocation. */ export interface GetInvocationResult { readonly functionName: string; /** * The provider-assigned unique ID for this managed resource. */ readonly id: string; readonly input: string; readonly qualifier?: string; readonly region: string; /** * String result of the Lambda function invocation. */ readonly result: string; } /** * 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](https://docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html#API_Invoke_RequestSyntax) 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 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 */ export declare function getInvocationOutput(args: GetInvocationOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetInvocationResult>; /** * A collection of arguments for invoking getInvocation. */ export interface GetInvocationOutputArgs { /** * Name of the Lambda function. */ functionName: pulumi.Input<string>; /** * String in JSON format that is passed as payload to the Lambda function. * * The following arguments are optional: */ input: pulumi.Input<string>; /** * Qualifier (a.k.a version) of the Lambda function. Defaults to `$LATEST`. */ qualifier?: pulumi.Input<string>; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input<string>; }