简体   繁体   中英

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?

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"}'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM