Omroth
Omroth

Reputation: 1139

How to encrypt a large number of existing files in S3

I have too many files to encrypt manually in the console - is there an awscli command I can run to encrypt all files in a bucket with SSE-S3?

Upvotes: 1

Views: 232

Answers (1)

jarmod
jarmod

Reputation: 78840

To encrypt an existing S3 object using Server-Side Encryption (SSE-S3), copy the file over itself, adding the encryption option --sse AES256. For example:

aws s3 cp s3://mybucket/cat.jpg s3://mybucket/cat.jpg --sse AES256

For large numbers of objects, you will want to automate this, perhaps using S3 Batch.

Upvotes: 2

Related Questions