Is it possible to use PHP to code an Amazon Lambda function? - amazon-web-services

Is it possible to use other languages aside from Node.js, Python, Java, and C# with lambda?

Natively AWS Lambda supports only following languages
Java 8
C#
Edge Node.js 4.3
Node,js 4.3
Node.js 6.10
Python 2.7
Python 3.6
However, if you want to use PHP, you can still do that with a bit of a workaround as outlined in the blog Scripting Languages for AWS Lambda: Running PHP, Ruby, and Go.

you need to upload php binaries (php executable, .so files etc) and ini files as part of your lambda deployment.
one good option for doing this is https://serverless.com/
and then you need something to manage the execution of the php functions.
check this out: https://github.com/niron1/serverless-php-lambda
(I'm the author)

Related

how to run Langage C code in a AWS Lambda?

I looking for documentation on official AWS: https://aws.amazon.com/lambda/faqs/?nc1=h_ls
I find this:
Q: What languages does AWS Lambda support?
AWS Lambda natively supports Java, Go, PowerShell, Node.js, C#, Python, and Ruby code, and provides a Runtime API which allows you to use any additional programming languages to author your functions. Please read our documentation on using Node.js, Python, Java, Ruby, C#, Go, and PowerShell.
I do not find this documentation API. I want find a simple programme read/write file in langage C. after I will want expose after a API gateway.
There are two solutions to that:
Develop your own custom lambda runtime for that. AWS provides some guides and examples of how to do it for C++ in Introducing the C++ Lambda Runtime
Use lambda container images which allow you to run docker containers (properly prepared) for your function.

Does AWS CDK support multiple languagues within a project?

If I am developing an app using the AWS CDK, can I use one language for the infrastructure and a separate language for my lambda code?
For example, can I create buckets, rules, lambdas etc. with typescript, but then deploy python code within the lambda? Especially considering I may need to pass a newly created bucket to the python code.
You can certainly do this. If you take a look at the "serverless" examples for CDK, you'll see that for all of the supported languages the Lambda that is created is built in Node. The Java examples, for example, includes ways to build with the Java CDK and, inside of the project, include the JavaScript code. Python and C# are very similar.

In Firebase how do I run C++ in functions?

I want to run C++ code in the backend, so in functions. Does anyone know how?
The question is generic on purpose, because I do not care how the code is built or called.
My initial thought was calling a C++ lib in nodejs, using FFI. I am still working on it, but I want to explore other options.
Nevertheless, my searches always lead to C++ projects running on the client side, and that not what I am looking for.
If something is unclear, please ask.
Your help will be much appreciated.
As mentioned by Dharmaraj in the comments,
As far as I know, you can use only Javascript and Typescript in
Firebase Cloud Functions. Though you get more options like python, go
and a few more in GOOGLE Cloud Functions.
the only available language (as standard) in Firebase Functions/Hosting is JavaScript (NodeJS) or TypeScript. There are a few ways out there that attempt to make languages such as PHP work, however I will not link any as I have never tried any.
Google Cloud does offer a server environment with languages such as Go, Python, PHP (potentially C++), as opposed to a serverless environment that Firebase Functions runs in. A serverless environment means that code cannot automatically run in the backend and must be called via HTTP request, pub/sub or cron job.

Migration of Lua REST microservice to AWS Lambda

On my project I have few microservices written on Lua which are hosted on Heroku. Currently we are migrating to AWS and as part of that migration we are looking for ways how easier to migrate our Lua services. I know that we could take usual EC2 for that purpose, but I'd like to try find some more cost-effective solutions.
As AWS Lambda by default does not supports Lua language for writing functions I'm interested in what's the easiest way to migrate my existing Lua services to Lambda? Maybe does it make sense try to run it on some of JVM implementation for Lua (like luaj or Rembulan) or it will be better just rewrite our services on something what's supported by AWS Lambda (like Python or Go)?
You can use Lua bindings from some other language.
Nice approach we tried was using Rust bindings (https://github.com/kyren/rlua) and AWS also supports Rust runtime (https://aws.amazon.com/blogs/opensource/rust-runtime-for-aws-lambda/)

Can I use gamelift with node.js servers?

I know it may sound as a stupid question but I am new to all this backend stuff, so take it into account pls.
So, gamelift gives you a fleet of Amazon Linux (or Windows) servers where you can put your game and on top of that a lot of fancy features for gamedev. So if it is a simple Linux can I put there my node.js application? And if not then can I at least use some of the Gamelift functionality (SDK which is available in javascript) while having my servers on ECS for example.
Not a JS user, but come across this question.
It seems that Amazon has released GameLift SDK for Node.js: https://github.com/aws/aws-sdk-js
You can use below command to install:
npm install aws-sdk
I'm currently trying out different solutions. But you can use node.js to create game server on Gamelift.
There are 2 options:
Realtime server - basically already setup environment to start a game server using node
Custom server - Amazon supports only a couple of languages with their server SDK and js isn't one of them. Fortunately the user dplusic at Github rewrote C# SDK in js, you should be able to use it to run a custom server using node.js