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