python - AWS S3: Enable encryption through API/Script -


we have images stored in aws s3 our production services.
there api allow enable encryption on these existing resources without downloading , uploading again?

i see boto module in python allows clone key additional parameters e.g encryption, create new key. these keys stored in separate database, want retain existing keys enable encryption.

here's code convert files in bucket use server-side encryption:

import boto  conn = boto.connect_s3('region') bucket = conn.get_bucket('bucket')  k in bucket.list():   bucket.copy_key(new_key_name=k.key, src_bucket_name=bucket.name, src_key_name=k.key, encrypt_key=true) 

it copies same key name, might want tweak preserve storage class, acls, etc.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -