Skip to main content

Command Palette

Search for a command to run...

Create Private S3 Bucket via AWS CLI

How to Use AWS CLI for Creating Private S3 Buckets

Published
1 min read
Create Private S3 Bucket via AWS CLI
A

Infosec Poet and CAP-certified DevOps/SecOps Engineer, passionate about security, creativity, and continuous learning.

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

Cloud Platforms

Part 15 of 48

This series covers cloud platforms (AWS, Azure, GCP, OCI), including certifications, labs, issues, solutions, and billing. We'll also explore on-premises solutions and hybrid cloud environments.

Up next

Implement VPC IPv6

Steps to Implement IPv6 in Virtual Private Cloud