Class InvocationType
(experimental) The type of invocation.
Inheritance
Namespace: Amazon.CDK.IntegTests
Assembly: Amazon.CDK.IntegTests.dll
Syntax (csharp)
public sealed class InvocationType : Enum
Syntax (vb)
Public NotInheritable Class InvocationType
Inherits
Enum
Remarks
Default is REQUEST_RESPONE
Stability: Experimental
ExampleMetadata: infused
Examples
App app;
Stack stack;
Queue queue;
IFunction fn;
var integ = new IntegTest(app, "Integ", new IntegTestProps {
TestCases = new [] { stack }
});
integ.Assertions.InvokeFunction(new LambdaInvokeFunctionProps {
FunctionName = fn.FunctionName,
InvocationType = InvocationType.EVENT,
Payload = JSON.Stringify(new Dictionary<string, string> { { "status", "OK" } })
});
var message = integ.Assertions.AwsApiCall("SQS", "receiveMessage", new Dictionary<string, object> {
{ "QueueUrl", queue.QueueUrl },
{ "WaitTimeSeconds", 20 }
});
message.AssertAtPath("Messages.0.Body", ExpectedResult.ObjectLike(new Dictionary<string, object> {
{ "requestContext", new Dictionary<string, string> {
{ "condition", "Success" }
} },
{ "requestPayload", new Dictionary<string, string> {
{ "status", "OK" }
} },
{ "responseContext", new Dictionary<string, int> {
{ "statusCode", 200 }
} },
{ "responsePayload", "success" }
}));
Synopsis
Fields
DRY_RUN | (experimental) Validate parameter values and verify that the user or role has permission to invoke the function. |
EVENT | (experimental) Invoke the function asynchronously. |
REQUEST_RESPONE | (experimental) Invoke the function synchronously. |
value__ |
Fields
DRY_RUN
(experimental) Validate parameter values and verify that the user or role has permission to invoke the function.
public const InvocationType DRY_RUN
Field Value
Type | Description |
---|---|
InvocationType |
Remarks
Stability: Experimental
EVENT
(experimental) Invoke the function asynchronously.
public const InvocationType EVENT
Field Value
Type | Description |
---|---|
InvocationType |
Remarks
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.
Stability: Experimental
REQUEST_RESPONE
(experimental) Invoke the function synchronously.
public const InvocationType REQUEST_RESPONE
Field Value
Type | Description |
---|---|
InvocationType |
Remarks
Keep the connection open until the function returns a response or times out. The API response includes the function response and additional data.
Stability: Experimental
value__
public int value__
Field Value
Type | Description |
---|---|
System.Int32 |