AWS for Beginners — Top 7 Commands for Managing Amazon S3 Buckets and Objects with AWS CLI — Part 75

BDRSuite
2 min readNov 12, 2024

--

The AWS Command Line Interface (AWS CLI) is a set of command-line tools provided by Amazon Web Services (AWS) to interact with and manage AWS services and resources directly from your terminal or command prompt. It allows developers, system administrators, and AWS users to perform various tasks such as creating and managing EC2 instances, configuring Amazon S3 buckets, monitoring AWS resources, and more, all from the command line.

You can use the AWS CLI in scripts and automation workflows to perform tasks like creating, managing, and monitoring AWS resources. This is valuable for infrastructure as code (IaC) and DevOps practices.

Some of the operations that you can perform with AWS CLI for S3 is given below.

  • Create a S3 bucket
  • List buckets and objects
  • Delete S3 bucket
  • Delete objects
  • Move objects
  • Copy objects
  • Sync objects

Configuring AWS CLI

Configuring the AWS Command Line Interface (AWS CLI) is the first step that allows you to interact with AWS services from your command line or terminal.

You have to create an access key and secret in AWS IAM console for a user that you intend to use for CLI operations.

$ aws configure –profile default
AWS Access Key ID [****************GDS5]: ABCD6729HDSDJFHJSJ7
AWS Secret Access Key [****************QKKK]: kHtYEIKJHAKSHDJKAHSK88+-SJHD
Default region name [us-east-1]:
Default output format [text]:

Top 7 AWS CLI S3 Commands

How to Create a S3 bucket using AWS CLI

1) Create S3 Bucket: AWS CLI command — ‘mb‘ is used to create a bucket.

Syntax: aws s3 mb s3://bucket-name

Example:

$ aws s3 mb s3://demo-ux-s3–01
make_bucket: demo-ux-s3–01

Read this article to know more…

--

--

BDRSuite
BDRSuite

Written by BDRSuite

BDRSuite is a comprehensive backup and disaster recovery solution designed to protect the data across diverse IT infrastructures.

No responses yet