Amazon Simple Storage Service (S3) is a highly scalable, reliable, secure, fast, inexpensive, and durable object storage service. It's designed to store and retrieve any amount of data at any time from anywhere on the web.
At its core, S3 stores data as objects within buckets. A bucket is a container for storing objects. Each object in an S3 bucket has a key (which uniquely identifies it), metadata (information about the object), and optionally, user-defined tags.
To create an S3 bucket using the AWS CLI, follow these steps:
Install AWS CLI: If you haven't already, install the AWS CLI by following the instructions on the AWS CLI installation page.
Configure AWS CLI: Configure your AWS credentials using the aws configure command.
$ aws configure
Create a Bucket: Use the aws s3api create-bucket command to create a new bucket.
1$ aws s3api create-bucket \2--bucket my-unique-bucket-name \3--region us-west-2
Verify Bucket Creation: List your S3 buckets to verify that the new bucket has been created.
$ aws s3 ls
2021-09-01 12:00:00 my-unique-bucket-name
Once you have a bucket, you can upload and download files using the AWS CLI.
To upload a file to your S3 bucket, use the aws s3 cp command.
1$ aws s3 cp my-file.txt s3://my-unique-bucket-name/
To download a file from your S3 bucket, use the same aws s3 cp command but reverse the source and destination.
1$ aws s3 cp s3://my-unique-bucket-name/my-file.txt my-downloaded-file.txt
In the next section, we will delve deeper into creating an S3 bucket using the AWS Management Console. This will provide a more visual understanding of how to manage your storage resources.
Stay tuned for more tutorials on Amazon Web Services!