AWS Lambda - CloudWatch Event type

后端 未结 3 494
野的像风
野的像风 2021-02-05 03:07

When writing an AWS Java Lambda function that\'s triggered by Cloudwatch scheduled events, which event object gets passed to the Lambda handler function?

For example, fo

3条回答
  •  被撕碎了的回忆
    2021-02-05 03:41

    Following is the boilerplate code for it.

    import com.amazonaws.services.lambda.runtime.Context;
    import com.amazonaws.services.lambda.runtime.events.ScheduledEvent;
    
    
    public class CollectionLambda {
        public void eventHandler(ScheduledEvent event, Context context) {
            // todo
        }
    }
    

    Add following dependencies for maven:

    
        com.amazonaws
        aws-lambda-java-core
        1.2.0
    
    
    
        com.amazonaws
        aws-lambda-java-events
        2.2.2
    
    

提交回复
热议问题