aws lambda permissions

so i’m writing a webhook for IFTTT using aws lambda. spent an embarassing amount of time looking for the problem with my cloudformation and lambda deployment. this is what i had in cloudformation:

  Type: AWS::IAM::Role
      Version: "2012-10-17"
          Effect: "Allow"
            - "sts:AssumeRole"
    Path: /
  Type: AWS::IAM::Policy
      - !Ref PocketLogRole
    PolicyName: pocketlog-cloudwatch
      Version: 2012-10-17
          Effect: Allow
            - logs:*
            - arn:aws:logs:*:*:*

the function would execute fine, return the expected value, but my logs wouldn’t show up in cloudwatch. the derp: i never wrote anything to stdout. used the python logging module throughout. didn’t assign a streamhandler to it though. my function was whispering into the ether.


once upon a time, i had a wordpress here. i hated it. still do. it feels like killing an ant with a sledgehammer. it’s slow and prone to plugin overload. going to keep it simple.

all the source for my site and its infrastructure is available on gitlab. i’ll be writing up a more formal page (i may even use Caps in it) where i document the site and its costs. i’d really like to get a live readout on costing direct from aws. we shall see.

no more sledgehammer

pelican is a static site generator. give it a theme (which is easy to customise) and some markdown-formatted source files, and it will give you a modern site encoded entirely in html. unlike wordpress or joomla, there’s no server-side processing or databases required. using it here because: community, simplicity, and python.

as cheap as possible, without being slow and crappy.

i’ve been bathing in the aws kool-aid for a while, so it was the natural choice. this site is 1.3mb in this initial state. it’s stored on s3 at reduced redundancy, so per month, that 1.3mb costs about $0.0000312. s3 is also the webserver, auto-scaling load balancer, and the redundant host. all that costs very little though. data transfer out will cost $0.90 if i get 8,500 whole-site downloads in a month. the average visitor will (hopefully) not download my whole site. there a $0.004 in charges for each 10,000 requests. each page load is made up of many requests so this could scale up into pennies territory fast. it costs $0.50/month to host my domain with aws.

tl;dr: a fast reliable website hosted for $12/yr, if i’m popular. less if i ...