step#

Developer note:

every function in the step.py module should have visualized logging.

aws_ops_alpha.project.simple_lbd_agw_chalice.step.download_deployed_json(semantic_branch_name: str, runtime_name: str, env_name: str, bsm_devops: BotoSesManager, pyproject_ops: pyops.PyProjectOps, s3path_deployed_json: S3Path, check=True, step: str = 'DEPLOY_CHALICE_APP', truth_table: Optional[TruthTable] = None, url: Optional[str] = None) bool[source]#

See aws_ops_alpha.aws_helpers.aws_chalice_helpers.download_deployed_json().

Parameters:
  • semantic_branch_name – semantic branch name for conditional step test.

  • runtime_name – runtime name for conditional step test.

  • env_name – env name, will be used for conditional step test.

  • bsm_devops – the devops AWS Account BotoSesManager object.

  • pyproject_opsPyProjectOps object.

  • s3path_deployed_json – the S3 path to the deployed ${env_name}.json file.

  • check – whether to check if we should run this step.

  • step – step name for conditional step test.

  • truth_table – truth table for conditional step test.

  • url – print the Google sheet url when conditional step test failed.

aws_ops_alpha.project.simple_lbd_agw_chalice.step.upload_deployed_json(semantic_branch_name: str, runtime_name: str, env_name: str, bsm_devops: BotoSesManager, pyproject_ops: pyops.PyProjectOps, s3path_deployed_json: S3Path, source_sha256: Optional[str] = None, tags: Optional[Dict[str, str]] = None, check=True, step: str = 'DEPLOY_CHALICE_APP', truth_table: Optional[TruthTable] = None, url: Optional[str] = None) bool[source]#

See aws_ops_alpha.aws_helpers.aws_chalice_helpers.upload_deployed_json().

Parameters:
  • semantic_branch_name – semantic branch name for conditional step test.

  • runtime_name – runtime name for conditional step test.

  • env_name – env name, will be used for conditional step test.

  • bsm_devops – the devops AWS Account BotoSesManager object.

  • pyproject_opsPyProjectOps object.

  • s3path_deployed_json – the S3 path to the deployed ${env_name}.json file.

  • tags – optional AWS resource tags.

  • check – whether to check if we should run this step.

  • step – step name for conditional step test.

  • truth_table – truth table for conditional step test.

  • url – print the Google sheet url when conditional step test failed.

aws_ops_alpha.project.simple_lbd_agw_chalice.step.get_lock(vault: Vault, owner: str, bsm_devops: BotoSesManager) Optional[Lock][source]#

Get the concurrency lock.

Returns:

True if got the lock, False if not.

aws_ops_alpha.project.simple_lbd_agw_chalice.step.run_chalice_deploy(semantic_branch_name: str, runtime_name: str, env_name: str, chalice_app_name: str, bsm_devops: BotoSesManager, bsm_workload: BotoSesManager, pyproject_ops: pyops.PyProjectOps, s3path_deployed_json: S3Path, tags: Optional[Dict[str, str]] = None, check=True, step: str = 'DEPLOY_CHALICE_APP', truth_table: Optional[TruthTable] = None, url: Optional[str] = None) bool[source]#

Deploy lambda app using chalice.

The workflow is as follows:

  1. build lambda source code for lambda_app/vendor/${package_name} folder.

  2. run update_chalice_config.py script to update .chalice/config.json file.

  3. download the lambda_app/.chalice/deployed/${env_name}.json file.

  4. run chalice deploy command to deploy the lambda function.

  5. upload the lambda_app/.chalice/deployed/${env_name}.json file.

Parameters:
  • semantic_branch_name – semantic branch name for conditional step test.

  • runtime_name – runtime name for conditional step test.

  • env_name – env name, will be used for conditional step test.

  • chalice_app_name – the chalice app name, it will be used as part of the lambda function naming convention.

  • bsm_devops – the devops AWS Account BotoSesManager object.

  • bsm_workload – the workload AWS Account BotoSesManager object.

  • pyproject_opsPyProjectOps object.

  • s3path_deployed_json – the S3 path to the deployed ${env_name}.json file.

  • tags – optional AWS resource tags.

  • check – whether to check if we should run this step.

  • step – step name for conditional step test.

  • truth_table – truth table for conditional step test.

  • url – print the Google sheet url when conditional step test failed.

Returns:

a boolean flag to indicate whether it runs chalice deploy command.

aws_ops_alpha.project.simple_lbd_agw_chalice.step.run_chalice_delete(semantic_branch_name: str, runtime_name: str, env_name: str, chalice_app_name: str, bsm_devops: BotoSesManager, bsm_workload: BotoSesManager, pyproject_ops: pyops.PyProjectOps, s3path_deployed_json: S3Path, tags: Optional[Dict[str, str]] = None, check=True, step: str = 'DELETE_CHALICE_APP', truth_table: Optional[TruthTable] = None, url: Optional[str] = None) bool[source]#

Delete lambda app using chalice.

The workflow is as follows:

  1. create dummy .chalice/config.json file.

  2. download the lambda_app/.chalice/deployed/${env_name}.json file.

  3. run chalice delete command to delete the lambda function.

  4. upload the lambda_app/.chalice/deployed/${env_name}.json file.

Parameters:
  • semantic_branch_name – semantic branch name for conditional step test.

  • runtime_name – runtime name for conditional step test.

  • env_name – env name, will be used for conditional step test.

  • chalice_app_name – the chalice app name, it will be used as part of the lambda function naming convention.

  • bsm_devops – the devops AWS Account BotoSesManager object.

  • bsm_workload – the workload AWS Account BotoSesManager object.

  • pyproject_opsPyProjectOps object.

  • s3path_deployed_json – the S3 path to the deployed ${env_name}.json file.

  • tags – optional AWS resource tags.

  • check – whether to check if we should run this step.

  • step – step name for conditional step test.

  • truth_table – truth table for conditional step test.

  • url – print the Google sheet url when conditional step test failed.

Returns:

a boolean flag to indicate whether it runs chalice delete command.