The market's bucket, monster-market-1nlgnpi, has versioning on. This morning, someone uploaded an empty menu.html over the real menu, which listed the Dragon Egg.
- List the versions of
menu.html, with the command from the lesson. Find the older version: itsIsLatestisFalse. - Download that version into
~/menu.html, with its version id:
New command
aws s3api get-object
Downloads one object into a file. With --version-id, you get that version instead of the latest.
Usageaws s3api get-object --bucket bucket --key key --version-id version-id file
Example
aws s3api get-object --bucket dragon-photos-2026 --key price.txt --version-id KbQ1x8RzGv0TnGpwVQe price.txt
- Check it with
cat ~/menu.html, then upload it back withaws s3 cp, under the keymenu.html. It becomes the latest version.
Objectives
- Download the real menu to
~/menu.html. menu.htmlin the market's bucket is the real menu again.