To check if versioning is enabled in an S3 Bucket using Python boto3, we will need to use the get_bucket_versioning()
method of boto3 S3.
Below are 3 ways to code how to get the S3 Bucket versioning status using AWS-SDK for Python, boto3.
- Example 1: Code for checking the versioning status in an S3 Bucket using boto3 Client
- Example 2: Code for checking versioning status in an S3 Bucket using boto3 Resource via Bucket object
- Example 3: Code for checking versioning status in an S3 Bucket using boto3 Resource via Versioning object
The Python scripts below all do the same thing. They check the status of versioning in the target S3 Bucket named radishlogic-bucket.
You can choose whichever method you are comfortable with.
Continue reading How to check if versioning is enabled in an S3 bucket using Python boto3