Skip to content

Instantly share code, notes, and snippets.

View andrewmackett's full-sized avatar

Andrew Mackett andrewmackett

View GitHub Profile
@andrewmackett
andrewmackett / rds_download_log.py
Created April 22, 2020 14:54 — forked from joer14/rds_download_log.py
Ghetto workaround for downloading rds logs via the AWS REST interface. This uses the IAM credentials for the session so should 'just work' on a lambda without needing to hardcode credentials/pass them in via environmental variables etc.
"""
Craft a web request to the AWS rest API and hit an endpoint that actually works but isn't supported in the CLI or in Boto3.
Based on this: https://github.com/aws/aws-cli/issues/2268#issuecomment-373803942
"""
import boto3
import os
import sys, os, base64, datetime, hashlib, hmac, urllib
import requests
### Keybase proof
I hereby claim:
* I am andrewmackett on github.
* I am andrewmackett (https://keybase.io/andrewmackett) on keybase.
* I have a public key ASCUoiBT-qaMgNj57OI9-hgq4L05L3pnqmH3Xh8diQxQEAo
To claim this, I am signing this object: