aws s3api put-bucket-versioning --bucket <bucket-name> --versioning-configuration Status=Enabled
aws s3api put-public-access-block --bucket <bucket-name> --public-access-block-configuration "BlockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=true"
aws s3api put-bucket-encryption --bucket <bucket-name> --server-side-encryption-configuration '{"Rules": [{"ApplyServerSideEncryptionByDefault": {"SSEAlgorithm": "AES256"}}]}'
boto3
library in Python to interact with AWS services.put_bucket_encryption
method to enable server-side encryption for an S3 bucket.boto3
library in Python to interact with AWS services.put_bucket_versioning
method to enable versioning for an S3 bucket.boto3
library in Python to interact with AWS services.put_bucket_logging
method to enable logging for an S3 bucket.