To turn on S3 versioning from the AWS CLI, just run the following command:

<pre lang="bash">$ aws s3api put-bucket-versioning --bucket mybucket \
----versioning-configuration Status=Enabled