Skip to content

Instantly share code, notes, and snippets.

View paladin-dranser's full-sized avatar

Antoś Bućko paladin-dranser

View GitHub Profile
@hinchliff
hinchliff / c7n_run.py
Created April 19, 2019 12:31
Run a Cloud Custodian policy file from a Python script. Most useful perhaps to be able to run Cloud Custodian from AWS Lambda.
import os
import logging
from c7n.commands import run
from c7n.config import Config
logger = logging.getLogger()
logger.setLevel(logging.INFO)
# Capture our current directory
THIS_DIR = os.path.dirname(os.path.abspath(__file__))