Let's start by creating our very first S3 bucket. 🪣
Go to the Amazon S3 console.
You can find it by clicking Services at the top-left, navigating to the Storage category, and selecting S3.
Alternatively, you can search for S3 using the search box.
Once you're in the S3 console, click Create bucket at the top-right.
On the Create bucket page, under General configuration:
Choose a unique Bucket name. Keep in mind that bucket names must be unique across all AWS accounts and regions, so simple names are often already taken. For example, you can use a unique name like myfirstbucket82464329083.
7. Under Object Ownership, select the radio button ACLs enabled.
You'll learn more about ACLs (Access Control Lists) later in the course, but here's a teaser: An ACL = a set of rules that decides who can do what. Enabling ACLs in this S3 setup (what we just did) lets you control who can access and do things with specific files in your bucket. With ACLs, different AWS accounts can own and control different files in the same bucket. This can make managing who can do what a bit tricky.
The warning you see suggests that it's usually better to use something called "bucket policies" to keep things simpler. Bucket policies let you manage all the permissions for the whole bucket in one place. In this exercise, we're enabling ACLs to show you how they work.
8. Check the box for Block all public access.
9. Choose Create bucket.
On the next task, you will upload an S3 object to your S3 bucket
Task 2: Upload an object to the S3 bucket
Click on the name of the S3 bucket you created in Task 1.
Click Add files and select any file you want to upload, like an image (e.g., .jpg or .png). Click Upload.
You'll see the file being uploaded, ooo something exciting's brewing! When it's done, click Close.
Select the file you've just uploaded by checking the box next to its name. Then, choose Copy URL to get the Object URL.
Open a new browser tab, paste the Object URL, and hit Enter. You'll likely see an Access Denied message!
No worries, this is what we expected to happen - because we set up ACLs and blocked public access in Task 1. Have a look at step 3b of Task 1 to see how you enabled ACLs, and step 3c to see how you enabled Block all public access.
Task 3: Make the object public
In this task, let's fix the issue. We do this by making the S3 object public!
Choose the Permissions tab.
Under Block public access (bucket settings), click Edit.
Uncheck the Block all public access box.
Click Save changes.
In the pop up, type 'confirm'.
After you disable the block on public access, let's also disable ACLs (so that we aren't blocking public access to your object).
7. Go to the Objects tab, check the box next to your object, click Actions, and choose Make public using ACL.
8. Click Make public and close the status page.
9. Refresh the browser tab where you pasted the Object URL.
You should now be able to view the object because it's made public. Ayyy, nice work!
Task 4: Deleting the resources
In this task, you will delete the S3 object and bucket so we're not racking up any charges in our account.
To delete an S3 object, select it and choose Delete. Type permanently delete to confirm, and then click Delete objects.
Now, head back to the Buckets page (it's on the left hand pane), click on the circle next to the one you created, and choose Delete. Type the bucket name to confirm the deletion, and then click Delete bucket.
Nice work, you've completed this hands-on exercise!You have successfully: