Example usage for com.amazonaws.services.lambda AWSLambda createEventSourceMapping

List of usage examples for com.amazonaws.services.lambda AWSLambda createEventSourceMapping

Introduction

In this page you can find the example usage for com.amazonaws.services.lambda AWSLambda createEventSourceMapping.

Prototype

CreateEventSourceMappingResult createEventSourceMapping(
        CreateEventSourceMappingRequest createEventSourceMappingRequest);

Source Link

Document

Creates a mapping between an event source and an AWS Lambda function.

Usage

From source file:com.netflix.spinnaker.clouddriver.lambda.deploy.ops.UpsertLambdaEventSourceAtomicOperation.java

License:Apache License

private CreateEventSourceMappingResult createEventSourceMapping(LambdaFunction cache) {
    updateTaskStatus("Initializing Creation of AWS Lambda Function Event Source Mapping...");

    AWSLambda client = getLambdaClient();
    CreateEventSourceMappingRequest request = new CreateEventSourceMappingRequest()
            .withFunctionName(cache.getFunctionArn()).withBatchSize(description.getBatchsize())
            .withEnabled(description.getEnabled()).withStartingPosition("LATEST")
            .withEventSourceArn(description.getEventSourceArn());

    CreateEventSourceMappingResult result = client.createEventSourceMapping(request);
    updateTaskStatus("Finished Creation of AWS Lambda Function Event Mapping Operation...");

    return result;
}