

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 3
click for more info
Not enough gems
Cost: 6 gems
1: AWS S3
incomplete
2: S3 Buckets
incomplete
3: S3 Objects
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
The bucket is the highest level of organization in S3; it's a container for storing objects.
Some projects put everything in a single bucket, organizing objects by prefix (like folders). Other projects use multiple buckets for different purposes (for example, one for user uploads and another for static assets). There's no single right answer; it depends on your needs.
That said, you don't want to find yourself searching across multiple buckets for a file, so try to keep any collection of related files in the same bucket.
Buckets have globally unique names because they're part of the URL used to access them. If I make a bucket called bd-vids, you cannot also have a bd-vids bucket, even if you're in a separate AWS account.
Use the pattern suggested in the previous lesson: patientping-favicon-bucket-${codename}. Pick a random unique codename so your bucket name doesn't collide with others.
PatientPing's site is missing a favicon (the little icon in the browser tab). Instead of baking it into the app, we're going to put it in S3 so we can eventually serve it (and other static assets) through AWS' CloudFront CDN.
Cost check: S3 storage costs about $0.023 per GB per month. A small file like the one we'll be using is effectively free.
Create the S3 bucket:
Accidentally publishing sensitive information about your company in S3 buckets has happened more than a few times. It's led to a comical number of "Are you really sure you want to publish this bucket globally?!" prompts. Just smile at this Chesterton's fence and carry on.
Run and submit the CLI tests.
If you prefer to use the CLI:
aws s3 mb s3://patientping-favicon-bucket-YOUR_CODENAME --region us-east-1
aws s3api put-public-access-block \
--bucket patientping-favicon-bucket-YOUR_CODENAME \
--public-access-block-configuration "BlockPublicAcls=false,IgnorePublicAcls=false,BlockPublicPolicy=false,RestrictPublicBuckets=false"