Esempio n. 1
0
def pre_init(bosslet_config):
    """
    Create NodeJS config file from template.  
    Package NodeJS lambda function.
    Upload .zip to S3 bucket.
    """
    write_config_file(bosslet_config)
    copy_provisioners(bosslet_config)

    # Inject the current region into the lambda code
    region_json = const.repo_path('cloud_formation', 'lambda',
                                  'dynamodb-lambda-autoscale', 'src',
                                  'configuration', 'Region.json')
    with open(region_json, 'w') as fh:
        json.dump({'Region': bosslet_config.REGION}, fh)

    lambdas.load_lambdas_on_s3(
        bosslet_config,
        bosslet_config.names.dynamo_lambda.lambda_,
    )
Esempio n. 2
0
def pre_init(bosslet_config):
    """Send spdb, bossutils, lambda, and lambda_utils to the lambda build
    server, build the lambda environment, and upload to S3.
    """
    for lambda_name in get_lambdas(bosslet_config):
        load_lambdas_on_s3(bosslet_config, lambda_name)
Esempio n. 3
0
def pre_init(bosslet_config):
    """Build multilambda zip file and put in S3."""
    load_lambdas_on_s3(bosslet_config)
Esempio n. 4
0
#!/usr/bin/env python3

# Copyright 2016 The Johns Hopkins University Applied Physics Laboratory
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
Update an existing lambda function.  Note, that the lambda handler function
is not changed.

load_lambdas_on_s3() zips spdb, bossutils, lambda, and lambda_utils as found
in boss-manage's submodules and places it on the lambda build server.  Next,
makedomainenv is run on the lambda build server to create the virtualenv for
the lambda function.  Finally, the virutalenv is zipped and uploaded to S3.

update_lambda_code() tells AWS to point the existing lambda function at the
new zip in S3.
"""
import alter_path
from lib import configuration
from lib.lambdas import load_lambdas_on_s3, update_lambda_code
Esempio n. 5
0
def pre_init(bosslet_config):
    load_lambdas_on_s3(bosslet_config,
                       bosslet_config.names.cache_throttle.lambda_)
Esempio n. 6
0
 def run(self, args):
     lambdas.load_lambdas_on_s3(args.bosslet_config, args.lambda_name)