Create Private S3 Bucket Using AWS CLI

Create Private S3 Bucket via AWS CLI

How to Use AWS CLI for Creating Private S3 Buckets

Tasks

Create a S3 bucket through aws-cli with the following details:

  • The name of the S3 bucket must be xfusion-s3-29022.

  • The S3 bucket must block all public access, i.e., it must be a private bucket.

Steps

  1. Create the S3 bucket named xfusion-s3-29022 in the us-east-1 region:

     aws s3api create-bucket --bucket xfusion-s3-29022 --region us-east-1
  2. Block all public access to the bucket to make it private:

     aws s3api put-public-access-block \
     --bucket xfusion-s3-29022 \
     --public-access-block-configuration BlockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=true
  3. AWS CLI

  4. Verify now.

    #aws #cloudcomputing #happylearning