I have a bat file on an AWS Windows 2012 Server instance. Is it possible to run an AWS Lambda function (Python or Node) to execute the bat file?
Thanks
I have a bat file on an AWS Windows 2012 Server instance. Is it possible to run an AWS Lambda function (Python or Node) to execute the bat file?
Thanks
You could possibly use the EC2 Run Command feature to accomplish this. https://aws.amazon.com/ec2/run-command/
If I understand your question correctly, you're asking if it's possible to have your Lambda function connect to your EC2 instance and execute a .bat file?
If that's your question, than the answer is "no" unless (I think) your EC2 instance is publicly available. Currently, Lambda functions do not have access to anything behind a VPC.
https://aws.amazon.com/lambda/faqs/
Q: Can I access resources behind Amazon VPC with my AWS Lambda function?
AWS Lambda functions cannot currently access resources behind a VPC.
The above blog post said this would be available late 2015 (though it was written in Oct 2015), however it's still not available.
As was suggested, try using the EC2 run command instead.
You can rdp
in the instance and execute it or let lambda place a message/triger in the queue and let process on the instance know that script needs to run and trigger it.
Take a look at this question: launch a shell script from lambda in aws