Serverless Computing on Windows in AWS

I have a piece of code that I need to make available through the "Network". It is ideal for AWS Lambda with the HTTP API on top - stateless, free from side effects, fairly intense processor, blob in, blob out function. It is written in C # /. NET, but it is not pure .NET, it uses the UWP API , so Windows Server 2016 is required.

AWS Lambdas only works on Linux hosts , even C #. Is there a way to deploy this piece in the Amazon cloud without a server - maybe something other than lambda? I know that I can go with the EC2 VM, but this is what server architecture was invented for.

+6
source share
2 answers

Lambda is the only option for serverless computing on AWS and Lambda functions running only on Linux machines.

If you need to run server functions on a Windows computer, try Azure Functions . This is the equivalent of Lambda in the Microsoft cloud. I’m not sure if it works on a computer running Windows Server 2016 and cannot find links to the platform, but I would expect that they use their own technological technologies as a new service.

To confirm if a platform is needed, try this function:

using System.Management; using System.Net; using System.Threading.Tasks; public static async Task<HttpResponseMessage> Run(HttpRequestMessage req, TraceWriter log) { // Get OS friendly name // http://stackoverflow.com/questions/577634/how-to-get-the-friendly-os-version-name var caption = (from x in new ManagementObjectSearcher("SELECT Caption FROM Win32_OperatingSystem").Get().Cast<ManagementObject>() select x.GetPropertyValue("Caption")).FirstOrDefault(); string name = caption != null ? caption.ToString() : "Unknown"; // the function response return req.CreateResponse(HttpStatusCode.OK, name); } 
+4
source

I think yoy can achieve this through a combination of the CodeDeploy service and AWS CodePipeline.

Refer to this article:

http://docs.aws.amazon.com/codedeploy/latest/userguide/getting-started-windows.html

to learn how to deploy code through CodeDeploy. See this article later:

http://docs.aws.amazon.com/codepipeline/latest/userguide/getting-started-4.html

to find out how you can configure aws Pipline to invoke Code Deploy, and then perform a batch job on a created Windows machine (note: you probably want to use S3 instead of Github - which is possible with CodePipeline).

I would think about loading all of this configuration through a script - using aws cli - this way you can easily clear your resources like this:

: aws codepipeline delete-pipe --name "MyJob"

Of course, you can configure the pipeline through the aws web console and leave the pipeline configured to run your code regularly.

-one
source

Source: https://habr.com/ru/post/1013166/


All Articles