Skip to content

Instantly share code, notes, and snippets.

@thiagomgo
Created November 1, 2016 19:13
Show Gist options
  • Save thiagomgo/7f738b8d89a537ba1aa4d97d90b17c28 to your computer and use it in GitHub Desktop.
Save thiagomgo/7f738b8d89a537ba1aa4d97d90b17c28 to your computer and use it in GitHub Desktop.
A simple lambda function written in python to execute a curl command
def lambda_handler(event, context):
import subprocess
result = subprocess.call("curl -I http://foo.bar", shell=True)
return result
@HansonVPHAM
Copy link

Hi, I have the same issue. Did you figure out the workaround?

Thank you.

@pwilken
Copy link

pwilken commented Apr 12, 2019

0 => success

"returncode: Exit status of the child process. Typically, an exit status of 0 indicates that it ran successfully."
=> https://docs.python.org/3/library/subprocess.html

@JafarShaik01
Copy link

Hi,

im getting error
/bin/sh: curl: command not found.

any suggestions ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment