LambdaInvokeFunction

class aws_cdk.integ_tests.LambdaInvokeFunction(scope, id, *, function_name, invocation_type=None, log_type=None, payload=None)

Bases: AwsApiCall

(experimental) An AWS Lambda Invoke function API call.

Use this istead of the generic AwsApiCall in order to invoke a lambda function. This will automatically create the correct permissions to invoke the function

Stability:

experimental

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.integ_tests as integ_tests

lambda_invoke_function = integ_tests.LambdaInvokeFunction(self, "MyLambdaInvokeFunction",
    function_name="functionName",

    # the properties below are optional
    invocation_type=integ_tests.InvocationType.EVENT,
    log_type=integ_tests.LogType.NONE,
    payload="payload"
)
Parameters:
  • scope (Construct) –

  • id (str) –

  • function_name (str) – (experimental) The name of the function to invoke.

  • invocation_type (Optional[InvocationType]) – (experimental) The type of invocation to use. Default: InvocationType.REQUEST_RESPONE

  • log_type (Optional[LogType]) – (experimental) Whether to return the logs as part of the response. Default: LogType.NONE

  • payload (Optional[str]) – (experimental) Payload to send as part of the invoke. Default: - no payload

Stability:

experimental

Methods

assert_at_path(path, expected)

(experimental) Assert that the ExpectedResult is equal to the result of the AwsApiCall at the given path.

For example the SQS.receiveMessage api response would look like:

If you wanted to assert the value of Body you could do

Parameters:
Stability:

experimental

Return type:

None

expect(expected)

(experimental) Assert that the ExpectedResult is equal to the result of the AwsApiCall.

Parameters:

expected (ExpectedResult) –

Stability:

experimental

Return type:

None

get_att(attribute_name)

(experimental) Returns the value of an attribute of the custom resource of an arbitrary type.

Attributes are returned from the custom resource provider through the Data map where the key is the attribute name.

Parameters:

attribute_name (str) –

Stability:

experimental

Return type:

Reference

get_att_string(attribute_name)

(experimental) Returns the value of an attribute of the custom resource of type string.

Attributes are returned from the custom resource provider through the Data map where the key is the attribute name.

Parameters:

attribute_name (str) –

Stability:

experimental

Return type:

str

to_string()

Returns a string representation of this construct.

Return type:

str

Attributes

node

The construct tree node associated with this construct.

Static Methods

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters:

x (Any) –

Return type:

bool