Skip to content

Instantly share code, notes, and snippets.

@pgriess
Created February 20, 2017 18:03
Show Gist options
  • Save pgriess/0f8c6389d4be43b20f058ab3d3831197 to your computer and use it in GitHub Desktop.
Save pgriess/0f8c6389d4be43b20f058ab3d3831197 to your computer and use it in GitHub Desktop.
def aws4_signature_parts(...):
...
def aws_route53(aws_key, aws_key_secret, path, data=None):
url = 'https://route53.amazonaws.com/2013-04-01/{}'.format(path)
_, _, headers = aws4_signature_parts(
aws_key,
aws_key_secret,
'GET' if data is None else 'POST',
url,
data='' if data is None else data)
return urllib2.urlopen(urllib2.Request(url, headers=headers, data=data))
print aws_route53(aws_key, aws_secret, 'hostedzone').read()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment