Using Time-Based Locks on a Snapshot
Use time-based locks (governance or compliance) to protect File Storage snapshots from deletion for a specified retention period and help meet retention requirements.
Time-based locks provide retention protection for snapshots. In governance mode, you can set a time-limited lock or use a legal hold for protection without an end date. In compliance mode, locks become strict after a cool-off period.
You can also create a snapshot policy that automatically creates snapshots with time-based locks.
IAM Permissions
To manage snapshot locks, you must have permissions to create, update, and remove locks. Required permissions vary by lock type and mode (resource-based, governance, or compliance).
For details on File Storage permissions, see Policy Details for the File Storage service.
Locking a Time-Based Snapshot
Before you begin, confirm the following:
- You have an existing snapshot.
- You have these IAM permissions:
- To create a snapshot lock in governance mode, you must have
FILE_SYSTEM_MANAGE_SNAPSHOT_LOCK_GOVERNANCE. - To create a snapshot lock in compliance mode, you must have
FILE_SYSTEM_MANAGE_SNAPSHOT_LOCK_COMPLIANCE.
- To create a snapshot lock in governance mode, you must have
You can also use or use the API or CLI to lock a time based snapshot:
- API: Use the CreateSnapshot or UpdateSnapshot operations and pass
LockDurationDetailsparameter. - CLI: Use the
fs snapshot createorfs snapshot updatecommand and pass thelock_duration_detailsparameter.
Follow these steps to add a time-based lock to a snapshot in the console:
If you need to change lock settings later, override the snapshot lock. If you need to remove a lock (when allowed), unlock the snapshot.
Overriding a Time-Based Snapshot
Before you begin, confirm the following:
- To change or remove a snapshot lock while the snapshot is in governance mode, you must have
FILE_SYSTEM_MANAGE_SNAPSHOT_LOCK_GOVERNANCE. - To change or remove a snapshot lock while the snapshot is in compliance mode, you must have
FILE_SYSTEM_MANAGE_SNAPSHOT_LOCK_COMPLIANCE.
You can also use the API or CLI to override (edit) a time-based snapshot lock:
- API: Use the UpdateSnapshot operation and pass the
LockDurationDetailsparameter. - CLI: Use the
fs snapshot updatecommand and pass thelock_duration_detailsparameter.
Use this procedure to edit an existing time-based lock on a snapshot.
If you no longer need retention protection, unlock the snapshot (if allowed by the lock mode and current state).
Unlocking a Time-Based Snapshot
Before you begin, confirm the following:
- To remove a snapshot lock in governance mode, you must have
FILE_SYSTEM_MANAGE_SNAPSHOT_LOCK_GOVERNANCE. - To remove a snapshot lock in compliance mode (during the cool-off period), you must have
FILE_SYSTEM_MANAGE_SNAPSHOT_LOCK_COMPLIANCE.
You can also use the API or CLI to unlock (remove) a time-based snapshot lock (when allowed by the snapshot's current state):
- API: Use the UpdateSnapshot operation and update/clear the
LockDurationDetailsparameter. - CLI: Use the
fs snapshot updatecommand and update/clear thelock_duration_detailsparameter.
Use this procedure to remove a time-based lock from a snapshot.
If you still need basic protection that you can change later, consider using a resource-based lock.