michaeljwright/laravel-aws-lambda

This package is abandoned and no longer maintained. The author suggests using the aws-sdk-php-laravel package instead.

Allows php to respond to http requests on aws lambda

0.0.1 2017-07-04 19:05 UTC

This package is not auto-updated.

Last update: 2023-08-23 08:32:54 UTC


README

Want to build PHP applications comprised of microservices that run in response to events, auto-scale for you, and only charge you when they run. So do we! This Laravel Pluging lowers the total cost of maintaining our apps, enabling us to build more logic, faster. That right, more ... faster ... Laravel ... PHP ... does it get any better!?

Our company has a significant investment in PHP development as well as Amazon Web Services (AWS). We desire the ability to run Laravel/Lumen Applications in AWS Lambda despite the fact that PHP isn't formally supported.

We created a system for easily building PHP Executables that will run properly in AWS Lambda Functions. Then we set about the task of creating this plugin to allow easily integrating our application with the Lambda Runtime in order to enjoy serverless Lumen/Laravel apps.

Requirements

PHP Version 7.1 - Because I enjoy writing PHP 7.1 code and do not want to write something that is backward compatible.

Installation

composer require stechstudio/laravel-aws-lambda

Register the Provider:

For Lumen services, add:

$app->register(STS\Serverless\ServiceProvider::class);

to bootstrap/app.php. For Laravel applications, add:

STS\Serverless\ServiceProvider::class,

to the providers array in config/app.php.

Configuration

// @todo Actually fill this in. artisan aws-lambda:install - Copy all the PHP executable, libraries, and node.js stuff into place. artisan aws-lambda:package - Creates a zip archive that can be uploaded to AWS Lambda.

Use It

// @todo Actually fill this in. Local test with lambda-local if you have installed it.

lambda-local -l resources/nodejs/gateway.js -h handler -e resources/nodejs/event-samples/test-data.js