From 9351fe15d72c00936b5c99c7bf418588af919d88 Mon Sep 17 00:00:00 2001 From: carnal0wnage Date: Wed, 31 May 2017 11:16:29 -0400 Subject: [PATCH] add a script to test a list of buckets --- s3_bucket_list_fromfile.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 s3_bucket_list_fromfile.py diff --git a/s3_bucket_list_fromfile.py b/s3_bucket_list_fromfile.py new file mode 100644 index 0000000..bf10b06 --- /dev/null +++ b/s3_bucket_list_fromfile.py @@ -0,0 +1,23 @@ +import boto3 +import botocore + +import json +import urllib +import logging +import sys,os +import pprint + +pp = pprint.PrettyPrinter(indent=5, width=80) + +from s3.s3 import * + +AWS_ACCESS_KEY_ID = '' +AWS_SECRET_ACCESS_KEY ='' + +f = open('test.txt', 'r') +for line in f: + line = line.strip() + if not line: + continue + else: + get_s3bucket_policy(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY,line)