Ejemplo n.º 1
0
def start_lambda(port=None, asynchronous=False):
    from localstack.services.awslambda import lambda_api, lambda_utils
    from localstack.services.infra import start_local_api

    # print a warning if we're not running in Docker but using Docker based LAMBDA_EXECUTOR
    if "docker" in lambda_utils.get_executor_mode(
    ) and not config.is_in_docker and not is_linux():
        LOG.warning(
            ("!WARNING! - Running outside of Docker with $LAMBDA_EXECUTOR=%s can lead to "
             "problems on your OS. The environment variable $LOCALSTACK_HOSTNAME may not "
             "be properly set in your Lambdas."),
            lambda_utils.get_executor_mode(),
        )

    if config.is_in_docker and not config.LAMBDA_REMOTE_DOCKER and not config.dirs.functions:
        LOG.warning(
            "!WARNING! - Looks like you have configured $LAMBDA_REMOTE_DOCKER=0 - "
            "please make sure to configure $HOST_TMP_FOLDER to point to your host's $TMPDIR"
        )

    port = port or config.service_port("lambda")
    return start_local_api("Lambda",
                           port,
                           api="lambda",
                           method=lambda_api.serve,
                           asynchronous=asynchronous)
Ejemplo n.º 2
0
def start_elasticsearch_service(port=None, asynchronous=False):
    port = port or config.PORT_ES
    return start_local_api('ES',
                           port,
                           api='es',
                           method=es_api.serve,
                           asynchronous=asynchronous)
Ejemplo n.º 3
0
def start_cloudformation(port=None, asynchronous=False):
    port = port or config.service_port("cloudformation")
    return start_local_api(
        "CloudFormation",
        port,
        api="cloudformation",
        method=cloudformation_api.serve,
        asynchronous=asynchronous,
    )
Ejemplo n.º 4
0
def start_lambda(port=None, asynchronous=False):
    from localstack.services.awslambda import lambda_api
    from localstack.services.infra import start_local_api

    port = port or config.PORT_LAMBDA
    return start_local_api("Lambda",
                           port,
                           api="lambda",
                           method=lambda_api.serve,
                           asynchronous=asynchronous)
Ejemplo n.º 5
0
def start_cloudformation(port=None, asynchronous=False):
    from localstack.services.cloudformation import cloudformation_api
    from localstack.services.infra import start_local_api

    port = port or config.PORT_CLOUDFORMATION
    return start_local_api(
        "CloudFormation",
        port,
        api="cloudformation",
        method=cloudformation_api.serve,
        asynchronous=asynchronous,
    )
Ejemplo n.º 6
0
def start_dynamodbstreams(port=None, asynchronous=False):
    from localstack.services.dynamodbstreams import dynamodbstreams_api
    from localstack.services.infra import start_local_api

    port = port or config.PORT_DYNAMODBSTREAMS
    return start_local_api(
        "DynamoDB Streams",
        port,
        api="dynamodbstreams",
        method=dynamodbstreams_api.serve,
        asynchronous=asynchronous,
    )
Ejemplo n.º 7
0
def start_elasticsearch_service(port=None, asynchronous=False):
    """
    Starts the ElasticSearch management API (not the actual elasticsearch process.
    """
    from localstack.services.es import es_api

    port = port or config.PORT_ES
    return start_local_api("ES",
                           port,
                           api="es",
                           method=es_api.serve,
                           asynchronous=asynchronous)
Ejemplo n.º 8
0
def start_firehose(port=None, asynchronous=False):
    from localstack.services.firehose import firehose_api
    from localstack.services.infra import start_local_api

    port = port or config.PORT_FIREHOSE
    return start_local_api(
        "Firehose",
        port,
        api="firehose",
        method=firehose_api.serve,
        asynchronous=asynchronous,
    )