Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploy an AWS Lambda function with test events using AWS CDK

In the AWS Lambda management console you can have test events associated with a function.

Is it possible to configure the test events when deploying the Lambda function using the AWS CDK such that the test events are ready to use when someone later views the function in the management console?

like image 1000
Tom Dufall Avatar asked Jun 19 '26 06:06

Tom Dufall


1 Answers

That is not possible at the moment as CloudFormation itself does not support this (see this answer). You can, as mentioned in the linked post, use a CloudFormation CustomResource to prepare the invocation.

Another option is to create a output that prepares a cli command with payload. So that you can just copy past the generated call aws lambda invoke --function-name {PopulateFromCDK} --payload '{"key": "value"}'

like image 133
quadroid Avatar answered Jun 21 '26 23:06

quadroid



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!