Skip to content

Instantly share code, notes, and snippets.

@srkiNZ84
Last active November 28, 2016 21:44
Show Gist options
  • Save srkiNZ84/37a71dbb7f111dfc7265bbe0cf885128 to your computer and use it in GitHub Desktop.
Save srkiNZ84/37a71dbb7f111dfc7265bbe0cf885128 to your computer and use it in GitHub Desktop.
Simple AWS lambda function to demo "login"
from __future__ import print_function
import json
print('Loading login function')
def lambda_handler(event, context):
print('username gotten: ' + event['username'])
print('password gotten: ' + event['password'])
if(event['username'] == 'foo' and event['password'] == 'barbaz'):
print('Login Successful!!')
else:
print('Access Denied!!!')
{
"username": "foo",
"password": "barbaz"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment