AWS S3 Buckets

πŸ‘‹ πŸ‘‹ πŸ‘‹ πŸ‘‹ πŸ‘‹

Documentation

My Personal Documentation

AWS S3 Buckets

Steps Involved:

  • βœ… Log into AWS Management console

  • βœ… Choose region

  • βœ… Navigate to the Amazon S3 console

  • (Amazon S3 buckets form a global namespace, even though each bucket is created in a specific region)

  • βœ… Start the create bucket process

  • βœ… Name your bucket

  • βœ… Choose your region

Upload object

  • βœ… Load your new bucket in the Amazon S3 console
  • βœ… Select Upload, then Add Files
  • βœ… Start Upload. You will see the status of your file in the Transfers section

Open the Amazon S3 URL

  • βœ… Now open the properties for the object
  • βœ… Copy the Amazon S3 URL for the object
  • βœ… Paste the URL in the address bar of a new browser window or tab
  • βœ… When you get an XML error code AccessDenied

Make the Object Public

  • βœ… Go back to the Amazon S3 Console and select Make Public

Rename Object

  • βœ… Rename the object, but keep the same file extension.

Delete the Object

  • βœ… Select Delete and Select OK when prompted if you want to delete the object
  • βœ… To verify, try to reload the deleted object’s Amazon S3 URL (You should once again get the XML AccessDenied error message)

Enable Version Control

  • βœ… load the properties of your bucket. Don’t open the bucket.
  • βœ… Enable versioning in the properties and select OK to verify
  • (Note that versioning can be suspended, but not turned off.)

Create Multiple Versions of an Object

  • βœ… Create a text file with .txt extension on your computer and write what you want in the text file

  • βœ… Save the text file to a location of your choosing

  • βœ… Upload the text file to your bucket. This will be version 1

  • βœ… After you have uploaded the text file to your bucket, open the copy on your local computer and change the words

  • Save the text file with the original filename

  • βœ… Upload the modified file to your bucket

  • βœ… Select Show Versions on the uploaded object

  • You will now see two different versions of the object with different Version IDs and possibly different sizes

Delete an Object and Then Restore It

  • βœ… Open the bucket containing the text file with the two versions
  • βœ… Select Hide Versions
  • βœ… Select Delete, and then select OK to verify
  • βœ… Your object will now be deleted, and you can no longer see the object
  • βœ… Select Show Versions
  • Both versions of the object now show their version IDs

Restore an Object

  • βœ… Open your bucket
  • βœ… Select Show Versions
  • βœ… Select the oldest version and download the object
  • βœ… Upload to the same bucket
  • βœ… Select Hide Versions, and the file should re-appear

To restore a version, you copy the desired version into the same bucket. In the Amazon S3 console, this requires a download then re-upload of the object. Using APIs, SDKs, or AWS CLI, you can copy a version directly without downloading and re- uploading.

Lifecycle Management

  • βœ… Select your bucket
  • βœ… Under Properties, add a Lifecycle Rule
  • βœ… Explore the various options to add lifecycle rules to objects in this bucket
  • do not implement any of these options, as you may incur additional costs
  • Most lifecycle rules require some number of days to expire before the transition takes effect. For example, it takes a minimum of 30 days to transition from Amazon S3 Standard to Amazon S3 Standard-IA. This makes it impractical to create a lifecycle rule and see the actual result in an exercise

Enable Static Hosting on Your Bucket

  • βœ… Select your bucket

  • βœ… In the Properties section, select Enable Website Hosting

  • βœ… For the index document name, enter index.txt, and for the error document name, enter error.txt

  • Use a text editor to create two text files and save them as index.txt and error.txt. In the index.txt file, write the phrase β€œHello World,” and in the error.txt file, write thephraseβ€œError Page.”Save both text files and upload them to your bucket.

  • βœ… Make the two objects public

  • βœ… Copy the Endpoint: link under Static Website Hosting and paste it in a browser window or tab

  • In the address bar in your browser, try adding a forward slash followed by a made- up filename

  • You should now see the phrase "Error Page" displayed.

  • βœ… To clean up, delete all of the objects in your bucket and then delete the bucket itself