Example usage for com.amazonaws.services.lambda.model CreateFunctionRequest setMemorySize

List of usage examples for com.amazonaws.services.lambda.model CreateFunctionRequest setMemorySize

Introduction

In this page you can find the example usage for com.amazonaws.services.lambda.model CreateFunctionRequest setMemorySize.

Prototype


public void setMemorySize(Integer memorySize) 

Source Link

Document

The amount of memory that your function has access to.

Usage

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

License:Apache License

private CreateFunctionResult createFunction() {
    FunctionCode code = new FunctionCode().withS3Bucket(description.getProperty("s3bucket").toString())
            .withS3Key(description.getProperty("s3key").toString());

    Map<String, String> objTag = new HashMap<>();
    for (Map<String, String> tags : description.getTags()) {
        for (Entry<String, String> entry : tags.entrySet()) {
            objTag.put(entry.getKey(), entry.getValue());
        }/*from  ww  w  . j  av a 2s  .  c o  m*/
    }

    AWSLambda client = getLambdaClient();

    CreateFunctionRequest request = new CreateFunctionRequest();
    request.setFunctionName(description.getFunctionName());
    request.setDescription(description.getDescription());
    request.setHandler(description.getHandler());
    request.setMemorySize(description.getMemory());
    request.setPublish(description.getPublish());
    request.setRole(description.getRole());
    request.setRuntime(description.getRuntime());
    request.setTimeout(description.getTimeout());

    request.setCode(code);
    request.setTags(objTag);

    CreateFunctionResult result = client.createFunction(request);
    updateTaskStatus("Finished Creation of AWS Lambda Function Operation...");

    return result;
}