Files
weirdAAL/s3_list_bucket_contents_fromfile.py
Chris Gates 1755a6e809 Create s3_list_bucket_contents_fromfile.py
rename + add a comment
2017-06-12 21:32:12 -04:00

25 lines
468 B
Python

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 =''
#open a list of possible buckets and attempt to list the contents
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)