Skip to content
v2.275.0

Experimental

@aws-cdk/integ-tests-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.

LambdaInvokeFunctionProps Struct ​

Options to pass to the Lambda invokeFunction API call.

Example ​

ts
declare const lambdaFunction: lambda.IFunction;
declare const app: App;

const stack = new Stack(app, 'cdk-integ-lambda-bundling');

const integ = new IntegTest(app, 'IntegTest', {
  testCases: [stack],
});

const invoke = integ.assertions.invokeFunction({
  functionName: lambdaFunction.functionName,
});
invoke.expect(ExpectedResult.objectLike({
  Payload: '200',
}));

Properties ​

functionNamestringfunction_namestrfunctionNameStringFunctionNamestringFunctionName*stringrequired#
The name of the function to invoke.
invocationTypeoptionalInvocationTypeinvocation_typeoptionalInvocationTypeinvocationTypeoptionalInvocationTypeInvocationTypeoptionalInvocationTypeInvocationTypeoptionalInvocationType= InvocationType.REQUEST_RESPONSE#
The type of invocation to use.
logRetentionoptionalRetentionDayslog_retentionoptionalRetentionDayslogRetentionoptionalRetentionDaysLogRetentionoptionalRetentionDaysLogRetentionoptionalRetentionDays#
How long, in days, the log contents will be retained.

Default: no retention days specified

logTypeoptionalLogTypelog_typeoptionalLogTypelogTypeoptionalLogTypeLogTypeoptionalLogTypeLogTypeoptionalLogType= LogType.NONE#
Whether to return the logs as part of the response.
payloadoptionalstringpayloadoptionalstrpayloadoptionalStringPayloadoptionalstringPayloadoptional*string#
Payload to send as part of the invoke.

Default: no payload