DEV Community

Cover image for AWS S3 in 3 Minutes

AWS S3 in 3 Minutes

Justin Wheeler
Technologist with knowledge in Cloud Computing and programming. Fascinated by technology like AI, Blockchain, ML, and Quantum Computing.
・3 min read


AWS S3 stands for Simple Storage Service, which makes storage in the cloud extremely simple.


The service is feature rich with everything you could possibly want from a top tier storage solution:


These terms are widely used when discussing S3:

  • Arn: Amazon Resource Name; it's a unique id for AWS resources
  • Bucket: root object container; name must be globally unique
  • Key: object name including prefixes
  • Prefix: nested object container; name does not have to be unique
  • Object: data stored within a Bucket

Open Guide (Basics, Tips, Gotchas)



the console is a great place to learn, but it's bad practice to make changes in the console in a production environment. 🔥

Console 1

Console 2


 # lists buckets
 aws s3 ls 

 # lists objects
 aws s3 ls s3://my-bucket/     

 # upload file
 aws s3 cp file.txt s3://my-bucket/

 # download file
 aws s3 cp s3://my-bucket/file.txt .

 # removes file.txt from S3
 aws s3 rm s3://my-bucket/file.txt
Enter fullscreen mode Exit fullscreen mode

SDK (Python)

  # initialize client
  s3 = boto3.client('s3')

  # list buckets
  buckets = s3.list_buckets()
  for b in buckets:
      print(f"Bucket: {b}")

  # list objects
  bucket = s3.Bucket("my-bucket")
  for obj in bucket.objects.all():
      print(f"Object: {obj.Key}")

  # upload file
  s3.upload_file("file.txt", "my-bucket", "file.txt")

  # download file
  s3.download_file("my-bucket", "file.txt", "file.txt")

  # remove file
  s3.delete_object("my-bucket", "file.txt")
Enter fullscreen mode Exit fullscreen mode

Discussion (0)