-1

So currently I have an ec2 instance connected to Ubuntu and I want to use a lambda function that executes commands into ubuntu all by itself. Is there a way to do that?

Josh
  • 9
  • 1
  • This question can help you https://stackoverflow.com/questions/72045837/why-my-aws-lambda-function-doesnt-wait-for-ssm-send-command-which-runs-shell-s/72046380#72046380 – Paolo Jun 21 '22 at 18:20
  • Does this answer your question? [Can bash script be written inside a AWS Lambda function](https://stackoverflow.com/questions/34629574/can-bash-script-be-written-inside-a-aws-lambda-function) – matsev Jun 21 '22 at 20:54

1 Answers1

0

Yes you can execute OS commands on AWS Lambda. It's a very common thing. The exact way you would do it would depend on the language you picked. But a quick Google search will give you an example.

Remember that AWS Lambda runs on Amazon Linux. The packages might be different to the Ubuntu you've been using. There are docker images of the Lambda managed runtimes you can try locally to see if the packages you want to use are installed.

Mark Sailes
  • 727
  • 4
  • 16