aws_lambda_helpers#
This module implements the automation to manage AWS lambda artifacts, versions, etc …
- aws_ops_alpha.aws_helpers.aws_lambda_helpers.build_lambda_source(pyproject_ops: pyops.PyProjectOps, verbose: bool = True) Tuple[str, Path][source]#
Wrapper of
aws_lambda_layer.api.build_source_artifacts.Build lambda source artifacts locally and return source code sha256 and zip file path. It will NOT upload the artifacts to S3.
- Parameters:
pyproject_ops –
PyProjectOpsobject.- Returns:
tuple of two items: (source code sha256, zip file path)
- aws_ops_alpha.aws_helpers.aws_lambda_helpers.deploy_layer(bsm_devops: BotoSesManager, pyproject_ops: pyops.PyProjectOps, layer_name: str, s3dir_lambda: S3Path, tags: Dict[str, str]) Optional[LayerDeployment][source]#
Build layer locally, and upload layer artifacts to S3, then publish lambda layer.
This function doesn’t have any logging, it can make the final function shorter.
- Parameters:
bsm_devops – the devops AWS Account
BotoSesManagerobject.pyproject_ops –
PyProjectOpsobject.layer_name – Lambda layer name.
s3dir_lambda – the S3 folder to store all lambda layer version artifacts.
tags – optional AWS resource tags.
- aws_ops_alpha.aws_helpers.aws_lambda_helpers.deploy_layer_using_docker(bsm_devops: BotoSesManager, pyproject_ops: pyops.PyProjectOps, layer_name: str, s3dir_lambda: S3Path, tags: Dict[str, str], is_arm: bool)[source]#
Build layer locally using docker, and upload layer artifacts to S3, then publish lambda layer.
- Parameters:
bsm_devops – the devops AWS Account
BotoSesManagerobject.pyproject_ops –
PyProjectOpsobject.layer_name – Lambda layer name.
s3dir_lambda – the S3 folder to store all lambda layer version artifacts.
tags – optional AWS resource tags.
is_arm – is True, then build for ARM architecture, otherwise build for x86_64.
- aws_ops_alpha.aws_helpers.aws_lambda_helpers.grant_layer_permission(bsm_devops: BotoSesManager, workload_bsm_list: List[BotoSesManager], layer_deployment: LayerDeployment) List[str][source]#
Grant cross account Lambda layer permission.
- Parameters:
bsm_devops – the devops AWS Account
BotoSesManagerobject.workload_bsm_list – list of all workload AWS Accounts
BotoSesManagerobjects.layer_deployment – the lambda layer deployment object.
- aws_ops_alpha.aws_helpers.aws_lambda_helpers.explain_layer_deployment(bsm_devops: BotoSesManager, layer_deployment: Optional[LayerDeployment])[source]#
Print helpful information about the layer deployment.
- Parameters:
bsm_devops – the devops AWS Account
BotoSesManagerobject.layer_deployment – the lambda layer deployment object.