Amazon Simple Storage Service, commonly known as S3, is a versatile and scalable cloud storage service offered by Amazon Web Services (AWS). Think of it like Dropbox, Google Drive or Microsoft OneDrive. It provides a secure, durable, and highly available storage solution that allows you to store and retrieve data, making it a fundamental building block for many cloud-based applications and services.

While S3 can be managed through the AWS Management Console, it also offers a powerful command-line interface (CLI) for those who prefer to manage S3 resources programmatically. The AWS CLI provides a set of commands that enable users to interact with S3 buckets and objects, making it a valuable tool for developers, system administrators, and DevOps professionals.

In this guide, I will dive into using AWS CLI commands to perform common tasks in S3 that will help to build your confidence so that you don’t have to open up the AWS console every time. Whether you’re new to S3 or looking to enhance your cloud storage skills, mastering AWS CLI commands can significantly streamline your S3 workflows and help you leverage the full potential of the S3 cloud storage service. Let’s get started!


System Setup

Before you can start using any CLI commands with S3, you will need to make sure you have:

  1. The required permissions to use and access S3 via the CLI.
  2. Generated and downloaded an IAM user access key and secret access key to give you CLI access.
  3. Installed the AWS CLI tool.
  4. Configured your local terminal/powershell using the *aws configure* command with your IAM user access keys.

I won't be covering how to do these things here however you can reference the below links regarding installing the AWS CLI and creating your user access keys:

Install or update the latest version of the AWS CLI - AWS Command Line Interface

Managing access keys for IAM users - AWS Identity and Access Management

Once you have completed the above steps, you will be ready to start using the AWS CLI with S3 on your laptop/computer.


AWS CLI S3 Commands

With S3, it is possible to use either:

The high level *aws s3* commands are typically used to execute common S3 tasks with simplified commands. The low level *aws s3api* commands are used for more advanced or custom interactions with S3 through API calls. Depending on the task you are trying to run, you may need to use the low level commands where a high level *aws s3* command is not sufficient. With this knowledge, we can now start to execute some commands.