Issue
Ive been looking for ways to create a lambda function that can access directly the contents of an EC2 Linux instance. My goal is to be able to call a script residing in the home directory AND pass in a variable which the script will use for processing.
Ive been looking at different ways of doing it, but I cant seem to find a concise solution. Thank you in advance!
Solution
If your instance has the SSM agent running on it then your Lambda can run the send-command.
Using the AWS-RunShellScript document your Lambda can execute a number of commands on your EC2 instance for you.
You could also create your own document for SSM passing in an argument for each of the variables.
Answered By - Chris Williams