Deploy a Symfony ❤️ application in AWS Lambda 💭

Our use case 🔧

Code production 💻

Let’s code

$ symfony new --full aws-lambda-linkedin-notifier
$ cd aws-lambda-linkedin-notifier
$ composer require eniams/linkedin-notifier

Enable the bridge (see documentation)

<?php
// config/bundles.php
return [
// others bundles,
Eniams\Notifier\LinkedIn\LinkedInNotifierBundle::class => ['all' => true]];// .env
LINKEDIN_DSN=

Logic to publish content

The code is ready! It’s Time to deploy 🚀

Deploy Configuration

$ npm install -g serverless
$ serverless config credentials --provider aws --key --secret
$ composer require bref/bref
$ serverless deploy
Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Uploading CloudFormation file to S3...
Serverless: Uploading artifacts...
Serverless: Uploading service notifier-linkedin-api.zip file to S3 (10.05 MB)...
Serverless: Validating template...
Serverless: Updating Stack...
Serverless: Checking Stack update progress...
....................
Serverless: Stack update finished...
Service Information
service: notifier-linkedin-api
stage: dev
region: eu-west-3
stack: notifier-linkedin-api-dev
resources: 15
api keys:
None
endpoints:
POST - https://xxx.execute-api.eu-west-3.amazonaws.com/dev/contents
functions:
website: notifier-linkedin-api-dev-website
layers:
None
Serverless: Removing old service artifacts from S3...
Serverless: Run the "serverless" command to setup monitoring, troubleshooting and testing.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Smaine Milianni

Smaine Milianni

429 Followers

Fullstack Developer- certified Symfony 4,5 and certified AWS Solution Architect - Freelancer - Remote Worker