
This assumes you have already configured the aws command line tool. If not, check out my article on Getting Started with the AWS CLI.
An S3 Bucket is similar to a Linux Samba share in that it is a mountable storage volume.
The aws s3api list-buckets command can be used to list your S3 buckets.
~]$ aws s3api list-buckets
{
"Buckets": [
{
"Name": "my-bucket-abcdefg",
"CreationDate": "2023-06-02T02:22:19+00:00"
}
],
"Owner": {
"DisplayName": "john.doe",
"ID": "ab0e0a411234d5103a77c82240d5abcdc41ff11cc325c65b5c777a5123443743"
}
}
The aws s3api get-public-access-block command can be used to determine if the S3 Bucket has a public access block. In this example, the S3 Bucket does have a public access block which means that public access to the S3 Bucket is disabled.
~]$ aws s3api get-public-access-block --bucket my-bucket-abcdefg
{
"PublicAccessBlockConfiguration": {
"BlockPublicAcls": true,
"IgnorePublicAcls": true,
"BlockPublicPolicy": true,
"RestrictPublicBuckets": true
}
}
The aws s3api delete-public-access-block command can be used to remove the public access block from the S3 Bucket.
aws s3api delete-public-access-block --bucket my-bucket-abcdefg
And then you can confirm that the Public Access Blocks are set to false.
~]$ aws s3api get-public-access-block --bucket my-bucket-abcdefg
{
"PublicAccessBlockConfiguration": {
"BlockPublicAcls": false,
"IgnorePublicAcls": false,
"BlockPublicPolicy": false,
"RestrictPublicBuckets": false
}
}
Did you find this article helpful?
If so, consider buying me a coffee over at