Skip to content

Instantly share code, notes, and snippets.

@ryantuck
Created July 16, 2016 23:24
Show Gist options
  • Select an option

  • Save ryantuck/d8e08dc9815ea75e532dd0a482537831 to your computer and use it in GitHub Desktop.

Select an option

Save ryantuck/d8e08dc9815ea75e532dd0a482537831 to your computer and use it in GitHub Desktop.
pygotham lambda talk
  • set up lambda (basic execution role)
  • just api call and return
  • incorporate boto3 writing to dynamodb
  • change input to handle date range or payload etc
  • change success message

testing in browser - woo fun, but let's make an api endpoint

  • make api endpoint with POST
  • test in browser

schedule that bad boy

  • configure cron

great, we have a job. what happens if it fails?

  • intro to cloudwatch logs
  • configure SNS etc
  • demo email or sms notifications

okay cool but no one uses stdlib and i need to write to a db homie

  • same thing, with requests and db module
  • run deploy for pushing lambda, all other things equal

test curl from CLI

todo

  • api.databae.io/cats

neat facts

  • free up to 1M requests (free ETLs - can't say same of spark)
  • lambdas run in response to stuff, s3 uploads, SNS notifications, etc.
  • gotcha - iam roles might be more restricted - YMMV, but SG/permissions are super easy regardless
  • limits (5 min, 1.5 GB) can be overcome through chaining etc, or you can go docker/stored procs/etc
  • hope this blows your mind like it did mine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment