Created
June 10, 2016 21:41
-
-
Save jonasfj/c129216da7ea73c1fa96ff80210ac507 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import taskcluster, boto.s3 | |
| auth = taskcluster.sync.Auth() | |
| result = auth.awsS3Credentials('read-write', 'tc-gp-public-31d', 'garbage/') | |
| s3 = boto.s3.connect_to_region( | |
| 'us-west-2', | |
| aws_access_key_id=result['credentials']['accessKeyId'], | |
| aws_secret_access_key=result['credentials']['secretAccessKey'], | |
| security_token=result['credentials']['sessionToken'], | |
| ) | |
| bucket = s3.get_bucket('tc-gp-public-31d', validate=False) | |
| k = bucket.new_key('garbage/test.txt') | |
| k.set_contents_from_string("Hello World") | |
| print "https://tc-gp-public-31d.s3-us-west-2.amazonaws.com/garbage/test.txt" |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
pip install taskcluster botofirst...But really we should probably be switching to boto3.