Lambda: Lambda class

LambdaR Documentation

Lambda class

Description

Contains lambda boto3 wrappers to Create, Update, Delete and Invoke Lambda functions.

Methods

Public methods


Method new()

Constructs a Lambda instance. This instance represents a Lambda function and provides methods for updating, deleting and invoking the function. This class can be used either for creating a new Lambda function or using an existing one. When using an existing Lambda function, only the function_arn argument is required. When creating a new one the function_name, execution_role_arn and handler arguments are required, as well as either script or zipped_code_dir.

Usage
Lambda$new(
  function_arn = NULL,
  function_name = NULL,
  execution_role_arn = NULL,
  zipped_code_dir = NULL,
  s3_bucket = NULL,
  script = NULL,
  handler = NULL,
  session = NULL,
  timeout = 120,
  memory_size = 128,
  runtime = "python3.8"
)
Arguments
function_arn

(str): The arn of the Lambda function.

function_name

(str): The name of the Lambda function. Function name must be provided to create a Lambda function.

execution_role_arn

(str): The role to be attached to Lambda function.

zipped_code_dir

(str): The path of the zipped code package of the Lambda function.

s3_bucket

(str): The bucket where zipped code is uploaded. If not provided, default session bucket is used to upload zipped_code_dir.

script

(str): The path of Lambda function script for direct zipped upload

handler

(str): The Lambda handler. The format for handler should be file_name.function_name. For ex: if the name of the Lambda script is hello_world.py and Lambda function definition in that script is

session

(sagemaker.session.Session): Session object which manages interactions with Amazon SageMaker APIs and any other AWS services needed. If not specified, new session is created.

timeout

(int): Timeout of the Lambda function in seconds. Default is 120 seconds.

memory_size

(int): Memory of the Lambda function in megabytes. Default is 128 MB.

runtime

(str): Runtime of the Lambda function. Default is set to python3.8.

lambda_handler(event,

context), the handler should be hello_world.lambda_handler


Method create()

Method to create a lambda function.

Usage
Lambda$create()
Returns

boto3 response from Lambda's create_function method.


Method update()

Method to update a lambda function.

Usage
Lambda$update()
Returns

: paws response from Lambda's update_function method.


Method invoke()

Method to invoke a lambda function.

Usage
Lambda$invoke()
Returns

paws response from Lambda's invoke method.


Method delete()

Method to delete a lambda function.

Usage
Lambda$delete()
Returns

paws response from Lambda's delete_function method.


Method format()

foramt class

Usage
Lambda$format()

Method clone()

The objects of this class are cloneable with this method.

Usage
Lambda$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


DyfanJones/sagemaker-r-common documentation built on June 14, 2022, 10:31 p.m.