In this section, you will learn how to record every version of an object. Along with durability, Amazon provides several techniques to secure the data in S3. Some of those techniques involve enabling versioning and encrypting the objects.
Versioning helps you to roll back to a previous version if any problem occurs with the current object during update, delete, or put operations.
Through encryption, you can control the access of an object. You need the appropriate key to read and write an object. You will also learn Multi-Factor Authentication (MFA) for delete operations. Amazon also allows Cross-Region Replication (CRR) to maintain a copy of an object in another Region, which can be used for data backup during any disaster, for further redundancy, or for the enhancement of data access speed in different Regions.
Let’s now understand how you can enable bucket versioning with the help of some hands-on examples. Bucket versioning can be applied while creating a bucket from the AWS S3 console:
$ aws s3 mb s3://version-demo-mlpractice/
$ aws s3api put-bucket-versioning –bucket version-demo-mlpractice –versioning-configuration Status=Enabled
$ aws s3api get-bucket-versioning –bucket version-demo-mlpractice
{
“Status”: “Enabled”
}
The server side encryption configuration was not found
$ aws s3api put-bucket-encryption –bucket version-demo-mlpractice –server-side-encryption-configuration ‘{“Rules”:[{“ApplyServerSideEncryptionByDefault”:
{“SSEAlgorithm”:”AES256″}}]}’
You will learn more about encryption in the next section.