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

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

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

android - How to create dynamically Fragment pager adapter -