def s3_put(opts={}, encrypt=False): session = boto3.session.Session(**aws_config()) s3 = session.client('s3') opts.setdefault('GrantRead', 'uri=http://acs.amazonaws.com/groups/global/AllUsers') if encrypt: opts.setdefault('ServerSideEncryption', 'AES256') s3.put_object(**opts)
def s3_get(opts={}): session = boto3.session.Session(**aws_config()) s3 = session.client('s3') return s3.get_object(**opts)