Lambda Utilities — sagemaker 2.247.0 documentation (original) (raw)

sagemaker

This module contains helper methods related to Lambda.

class sagemaker.lambda_helper.Lambda(function_arn=None, function_name=None, execution_role_arn=None, zipped_code_dir=None, s3_bucket=None, script=None, handler=None, session=None, timeout=120, memory_size=128, runtime='python3.8', vpc_config=None, environment=None, layers=None)

Bases: object

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

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.

Parameters:

create()

Method to create a lambda function.

Returns: boto3 response from Lambda’s create_function method.

update()

Method to update a lambda function.

Returns: boto3 response from Lambda’s update_function method.

upsert()

Method to create a lambda function or update it if it already exists

Returns: boto3 response from Lambda’s methods.

invoke()

Method to invoke a lambda function.

Returns: boto3 response from Lambda’s invoke method.

delete()

Method to delete a lambda function.

Returns: boto3 response from Lambda’s delete_function method.