Skip to content

Instantly share code, notes, and snippets.


Keybase proof

I hereby claim:

  • I am pauloprea on github.
  • I am paul_oprea ( on keybase.
  • I have a public key ASDqfzlvX3Ri1jTSkV2MZixXY0KYgq4Jo9kB9_UKJIUEUgo

To claim this, I am signing this object:

pauloprea /
Created Jan 21, 2017
Dynamic DNS Script for Amazon Lambda (to use with Amazon API Gateway)
import re
import boto3
def is_valid_host(host):
if len(host) > 255:
return False
if host[-1] == ".":
host = host[:-1]
allowed = re.compile("(?!-)[A-Z\d-]{1,63}(?<!-)$", re.IGNORECASE)
return all(allowed.match(x) for x in host.split("."))