Skip to content

Instantly share code, notes, and snippets.

@armenzg
Created June 20, 2016 19:02
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save armenzg/91bb3f786eecd51f96021e505e206ee2 to your computer and use it in GitHub Desktop.
import taskcluster, boto.s3
auth = taskcluster.sync.Auth()
result = auth.awsS3Credentials('read-write', 'tc-gp-public-31d', 'ateam/pulse-action-dev/')
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/ateam/pulse-action-dev/garbage/test.txt"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment