From a56cac3e09e065b42b2344423adbea3e02a4304d Mon Sep 17 00:00:00 2001 From: alok Date: Mon, 16 Jul 2018 10:39:21 -0700 Subject: [PATCH] s3 upload --- aws-experiment-launch/new_pipeline/upload_s3.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 aws-experiment-launch/new_pipeline/upload_s3.py diff --git a/aws-experiment-launch/new_pipeline/upload_s3.py b/aws-experiment-launch/new_pipeline/upload_s3.py new file mode 100644 index 000000000..94869160b --- /dev/null +++ b/aws-experiment-launch/new_pipeline/upload_s3.py @@ -0,0 +1,9 @@ +import boto3 +s3 = boto3.client('s3') +bucket_name = 'first-try' +s3.create_bucket(Bucket=bucket_name,ACL='public-read-write') +response = s3.list_buckets() +buckets = [bucket['Name'] for bucket in response['Buckets']] +print("Bucket List: %s" % buckets) +filename='myfirst.txt' +s3.upload_file(filename, bucket_name, filename) \ No newline at end of file