|
1 | | -# Amazon S3 getting started |
| 1 | +# S3: Store and retrieve objects |
2 | 2 |
|
3 | | -This tutorial demonstrates how to get started with Amazon S3 using the AWS CLI. You'll learn the fundamental concepts and operations for working with this AWS service through command-line interface. |
| 3 | +Create an S3 bucket, upload and download objects, enable versioning, configure encryption, and clean up. |
4 | 4 |
|
5 | | -You can either run the automated script `s3-gettingstarted.sh` to execute all operations automatically with comprehensive error handling and resource cleanup, or follow the step-by-step instructions in the `s3-gettingstarted.md` tutorial to understand each AWS CLI command and concept in detail. The script includes interactive prompts and built-in safeguards, while the tutorial provides detailed explanations of features and best practices. |
| 5 | +## Source |
6 | 6 |
|
7 | | -## Resources Created |
| 7 | +https://docs.aws.amazon.com/AmazonS3/latest/userguide/GetStartedWithS3.html |
8 | 8 |
|
9 | | -The script creates the following AWS resources in order: |
| 9 | +## Use case |
10 | 10 |
|
11 | | -- S3 bucket (primary bucket for tutorial) |
12 | | -- S3 bucket (secondary bucket for cross-region replication) |
13 | | -- S3 public access block configuration |
14 | | -- S3 bucket versioning configuration |
15 | | -- S3 bucket encryption configuration |
16 | | -- S3 object (sample text file) |
17 | | -- S3 object (sample image file) |
18 | | -- S3 object (sample document file) |
19 | | -- S3 bucket tagging configuration |
| 11 | +- ID: s3/getting-started |
| 12 | +- Phase: create |
| 13 | +- Complexity: beginner |
| 14 | +- Core actions: s3api:CreateBucket, s3api:PutObject, s3api:GetObject, s3api:CopyObject |
20 | 15 |
|
21 | | -The script prompts you to clean up resources when you run it, including if there's an error part way through. If you need to clean up resources later, you can use the script log as a reference point for which resources were created. |
| 16 | +## What it does |
| 17 | + |
| 18 | +1. Creates an S3 bucket with a random name |
| 19 | +2. Uploads a sample text file |
| 20 | +3. Downloads and displays the file |
| 21 | +4. Copies the object to a folder prefix |
| 22 | +5. Enables versioning and uploads a second version |
| 23 | +6. Configures SSE-S3 encryption and blocks all public access |
| 24 | +7. Tags the bucket |
| 25 | +8. Lists objects and object versions |
| 26 | +9. Cleans up all objects and the bucket |
| 27 | + |
| 28 | +## Running |
| 29 | + |
| 30 | +```bash |
| 31 | +bash s3-gettingstarted.sh |
| 32 | +``` |
| 33 | + |
| 34 | +To auto-run with cleanup: |
| 35 | + |
| 36 | +```bash |
| 37 | +echo 'y' | bash s3-gettingstarted.sh |
| 38 | +``` |
| 39 | + |
| 40 | +## Resources created |
| 41 | + |
| 42 | +- S3 bucket (with versioning, encryption, public access block, tags) |
| 43 | +- Objects (sample file, copy, second version) |
| 44 | + |
| 45 | +## Estimated time |
| 46 | + |
| 47 | +- Run: ~15 seconds |
| 48 | +- Cleanup: ~5 seconds |
| 49 | + |
| 50 | +## Cost |
| 51 | + |
| 52 | +Free tier eligible. Minimal charges for a few small objects. |
0 commit comments