@aws-cdk_integ-tests-alpha.InvocationType

enum InvocationType ๐Ÿ”น

LanguageType name
.NETAmazon.CDK.IntegTests.Alpha.InvocationType
Gogithub.com/aws/aws-cdk-go/awscdkintegtestsalpha/v2#InvocationType
Javasoftware.amazon.awscdk.integtests.alpha.InvocationType
Pythonaws_cdk.integ_tests_alpha.InvocationType
TypeScript (source)@aws-cdk/integ-tests-alpha ยป InvocationType

The type of invocation.

Default is REQUEST_RESPONE

Example

declare const app: App;
declare const stack: Stack;
declare const queue: sqs.Queue;
declare const fn: lambda.IFunction;

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

integ.assertions.invokeFunction({
  functionName: fn.functionName,
  invocationType: InvocationType.EVENT,
  payload: JSON.stringify({ status: 'OK' }),
});

const message = integ.assertions.awsApiCall('SQS', 'receiveMessage', {
  QueueUrl: queue.queueUrl,
  WaitTimeSeconds: 20,
});

message.assertAtPath('Messages.0.Body', ExpectedResult.objectLike({
  requestContext: {
    condition: 'Success',
  },
  requestPayload: {
    status: 'OK',
  },
  responseContext: {
    statusCode: 200,
  },
  responsePayload: 'success',
}));

Members

NameDescription
EVENT ๐Ÿ”นInvoke the function asynchronously.
REQUEST_RESPONE ๐Ÿ”นInvoke the function synchronously.
DRY_RUN ๐Ÿ”นValidate parameter values and verify that the user or role has permission to invoke the function.

EVENT ๐Ÿ”น

Invoke the function asynchronously.

Send events that fail multiple times to the function's dead-letter queue (if it's configured). The API response only includes a status code.


REQUEST_RESPONE ๐Ÿ”น

Invoke the function synchronously.

Keep the connection open until the function returns a response or times out. The API response includes the function response and additional data.


DRY_RUN ๐Ÿ”น

Validate parameter values and verify that the user or role has permission to invoke the function.