Note: The object lock policy can only be enabled when a bucket is created.
Adding an object lock policy to a bucket provides you with the ability to add retention and legal hold to the objects contained within.
You can also enable compliance mode to set a retention period to all of the contents within a bucket by default. Additionally, when object lock is applied, legal hold can be set on a version of an object within the bucket. See Setting legal hold on a version of an object.
To create a bucket with an object lock policy: