lambda.handler
Define the CloudEndure lambda function.
Attributes: LOG_LEVEL (str): REGION_OVERRIDE (str): If provided, this value will override the default AWS region. logger (logging.Logger): The logger to be used throughout execution of the AWS Lambda.
send_sqs_message
send_sqs_message(image_info: 'Dict[str, Any]')
Send a SQS message.
The message includes the AMI information that was created from the migrated instance that passed testing post migration in CloudEndure.
Raises: ClientError: The exception is raised in the event of a boto3 client error. ImproperlyConfigured: The exception is raised in the event of missing or invalid environment configuration settings.
Returns: bool: Whether or not the message has been sent successfully.
create_ami
create_ami(project_id: 'str', instance_id: 'str')
Create an AMI from the specified instance.
Args: project_id (str): The ID associated with the Project. instance_id (str): The ID associated with the AWS instance.
Raises: ClientError: The exception is raised in the event of a boto3 client error.
Returns: bool: Whether or not the AMI has been created successfully.
lambda_handler
lambda_handler(event: 'Dict[str, Any]', context: 'Dict[str, Any]')
Define the AWS Lambda entry point and handler.
Args: event (str): The event performed against Lambda. context (dict): The context of the request performed against Lambda.
Raises: ClientError: The exception is raised in the event of a boto3 client error. InvalidPayload: The exception is raised in the event of an invalid payload.
Returns: bool: Whether or not the lambda function has executed successfully.