How to modify Delete After Retention Compliance settings using Python Script?

This Python script has been created to modify (enable/disable) the Delete After Retention (DAR) Compliance settings along with a provision to modify Retention Time (in Days) for a bucket. 

 

PRE-REQUISITES

EXECUTION

  • When the script is executed, it presents the list of available regions as can be seen below:
Screen_Shot_2022-04-26_at_12.22.47_PM.png
  • After displaying the list of available regions, the script continues and the following information is requested:
      1. Wasabi Access Key
      2. Wasabi Secret Access Key
      3. Wasabi Bucket Name
      4. Region

Note: The above inputs should be valid and are mandatory for the script to continue with the execution. If any information is either invalid or missing, the script will terminate with an appropriate message.

Screen_Shot_2022-04-26_at_12.26.44_PM.png
  • After validating the input, the script will display the current compliance setting for the bucket & will give additional options to enable delete after retention/disable delete after retention/quit

Note:

  1. If compliance is disabled on the bucket, the script will display the Compliance status and will terminate.
  2. Only If ConditionalHold is enabled then the script will display the status for ConditionalHold:
Screen_Shot_2022-04-26_at_12.40.26_PM.png

 

  • If "Y" is selected to enable delete after retention, then an additional prompt to modify the retention time will be displayed by the script. After validating the input, the script will proceed to modify the delete after the retention flag along with retention time (in days). If the customer chose not to modify retention time, then only the delete after retention flag will be modified. After setting the DAR flag to true on the bucket, the script will display the status along with modified compliance settings. It will also prompt with options to enable delete after retention/disable delete after retention/quit. 
Screen_Shot_2022-04-26_at_1.09.50_PM.png

 

Note: Retention Time (in days) should be greater than ZERO. If ZERO is entered as input then the script will continue to prompt with options to enable delete after retention/disable delete after retention/quit

  • If "N" is selected to disable delete after retention, the script will proceed to disable the delete after retention for the bucket. After setting the DAR flag to false on the bucket, the script will display the status along with modified compliance settings. It will also prompt with options to enable delete after retention/disable delete after retention/quit.
mceclip0.png
  • If "Q" is selected the script will terminate with the message "Program Ended..." 
Screen_Shot_2022-04-26_at_1.22.12_PM.png
Have more questions? Submit a request