docs: def remove_all_lambda_permissions(app_name='', env='', region='us-east-1'):
      """Remove all foremast-* permissions from lambda.
  
      Args:
          app_name (str): Application name
          env (str): AWS environment
          region (str): AWS region
      """
      session = boto3.Session(profile_name=env, region_name=region)
      lambda_client = session.client('lambda')
      legacy_prefix = app_name + "_"
  
      lambda_arn = get_lambda_arn(app_name, env, region)
      lambda_alias_arn = get_lambda_alias_arn(app_name, env, region)
      arns = (lambda_arn, lambda_alias_arn)
  
      for arn in arns:
          try:
              response = lambda_client.get_policy(FunctionName=arn)
          except boto3.exceptions.botocore.exceptions.ClientError as error:
              LOG.info("No policy exists for function %s, skipping deletion", arn)
              LOG.debug(error)
              continue
  
          policy_json = json.loads(response['Policy'])
          LOG.debug("Found Policy: %s", response)
          for perm in policy_json['Statement']:
              if perm['Sid'].startswith(FOREMAST_PREFIX) or perm['Sid'].startswith(legacy_prefix):
                  lambda_client.remove_permission(FunctionName=arn, StatementId=perm['Sid'])
                  LOG.info('removed permission: %s', perm['Sid'])
              else:
                  LOG.info('Skipping deleting permission %s - Not managed by Foremast', perm['Sid'])