What is S3?

S3 (Simple Storage Service) = AWS cloud storage for files

Use cases: Store files, images, videos, backups, static websites


Important: S3 Bucket Names

Rules:

Problem: demo-bucket → Already taken by someone else

Solution: Make it unique → yourname-demo-bucket-2026


Resource Naming

resource "aws_s3_bucket" "demo_bucket" {
         ↑ Type (fixed)    ↑ Label (your choice)

  bucket = "actual-bucket-name"
}

# Access it:
aws_s3_bucket.demo_bucket.bucket
↑ Type        ↑ Label       ↑ Attribute (the actual name)

Remember: resource_type.your_label.attribute

Example: .bucket.bucket → First is your label, second is the attribute name


Method 1: Simple Bucket (Fixed Name)

main.tf