Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Function to invoke a lamdba from python
import boto3
client = boto3.client('lambda')
def invoke_lambda(stage: str, region: str, name: str) -> List[Dict[str, Any]]:
response = client.invoke(FunctionName=f"{stage}-{region}-{name}", InvocationType="RequestResponse")
string_response = response["Payload"].read().decode("utf-8")
return json.loads(string_response)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment