Skip to content

Commit 52a7fd7

Browse files
committed
Add README.md and tutorial walkthrough for script-only tutorials
1 parent de3f38e commit 52a7fd7

10 files changed

Lines changed: 259 additions & 0 deletions

File tree

tuts/198-s3-cors/README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# S3 Cors
2+
3+
An AWS CLI tutorial that demonstrates S3 operations.
4+
5+
## Running
6+
7+
```bash
8+
bash s3-cors.sh
9+
```
10+
11+
To auto-run with cleanup:
12+
13+
```bash
14+
echo 'y' | bash s3-cors.sh
15+
```
16+
17+
## What it does
18+
19+
1. Creating bucket"; aws s3api create-bucket --bucket "$B
20+
2. Setting CORS"; aws s3api put-bucket-cors --bucket "$B" --cors-configuration '{"CORSRules":[{"AllowedOrigins":["https://example.com"],"AllowedMethods":["GET","PUT"],"AllowedHeaders":["*"],"MaxAgeSeconds
21+
3. Getting CORS"; aws s3api get-bucket-cors --bucket "$B
22+
23+
## Resources created
24+
25+
- Bucket
26+
- Bucket Cors
27+
28+
The script prompts you to clean up resources when it finishes.
29+
30+
## Cost
31+
32+
Free tier eligible for most operations. Clean up resources after use to avoid charges.
33+
34+
## Related docs
35+
36+
- [AWS CLI s3 reference](https://docs.aws.amazon.com/cli/latest/reference/s3/index.html)
37+
- [AWS CLI s3api reference](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html)
38+

tuts/198-s3-cors/s3-cors.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# S3 Cors
2+
3+
## Prerequisites
4+
5+
1. AWS CLI installed and configured (`aws configure`)
6+
2. Appropriate IAM permissions for the AWS services used
7+
8+
## Step 1: Creating bucket"; aws s3api create-bucket --bucket "$B
9+
10+
The script handles this step automatically. See `s3-cors.sh` for the exact CLI commands.
11+
12+
## Step 2: Setting CORS"; aws s3api put-bucket-cors --bucket "$B" --cors-configuration '{"CORSRules":[{"AllowedOrigins":["https://example.com"],"AllowedMethods":["GET","PUT"],"AllowedHeaders":["*"],"MaxAgeSeconds
13+
14+
The script handles this step automatically. See `s3-cors.sh` for the exact CLI commands.
15+
16+
## Step 3: Getting CORS"; aws s3api get-bucket-cors --bucket "$B
17+
18+
The script handles this step automatically. See `s3-cors.sh` for the exact CLI commands.
19+
20+
## Cleanup
21+
22+
The script prompts you to clean up all created resources. If you need to clean up manually, check the script log for the resource names that were created.
23+
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# S3 Storage Classes
2+
3+
A read-only script that queries S3Api resources and displays information.
4+
5+
## Running
6+
7+
```bash
8+
bash s3-storage-classes.sh
9+
```
10+
11+
## What it does
12+
13+
1. Listing objects with storage classes
14+
2. Storage class reference
15+
16+
## Resources created
17+
18+
None — this script is read-only.
19+
20+
## Cost
21+
22+
No cost. This script only reads existing resources.
23+
24+
## Related docs
25+
26+
- [AWS CLI s3api reference](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html)
27+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# S3 Storage Classes
2+
3+
## Prerequisites
4+
5+
1. AWS CLI installed and configured (`aws configure`)
6+
2. Appropriate IAM permissions for the AWS services used
7+
8+
## Step 1: Listing objects with storage classes
9+
10+
The script handles this step automatically. See `s3-storage-classes.sh` for the exact CLI commands.
11+
12+
## Step 2: Storage class reference
13+
14+
The script handles this step automatically. See `s3-storage-classes.sh` for the exact CLI commands.
15+

tuts/206-s3-metrics/README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# S3 Metrics
2+
3+
A read-only script that queries Cloudwatch resources and displays information.
4+
5+
## Running
6+
7+
```bash
8+
bash s3-metrics.sh
9+
```
10+
11+
## What it does
12+
13+
1. Listing buckets with sizes
14+
2. Getting bucket metrics (request count)
15+
16+
## Resources created
17+
18+
None — this script is read-only.
19+
20+
## Cost
21+
22+
No cost. This script only reads existing resources.
23+
24+
## Related docs
25+
26+
- [AWS CLI cloudwatch reference](https://docs.aws.amazon.com/cli/latest/reference/cloudwatch/index.html)
27+
- [AWS CLI s3api reference](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html)
28+

tuts/206-s3-metrics/s3-metrics.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# S3 Metrics
2+
3+
## Prerequisites
4+
5+
1. AWS CLI installed and configured (`aws configure`)
6+
2. Appropriate IAM permissions for the AWS services used
7+
8+
## Step 1: Listing buckets with sizes
9+
10+
The script handles this step automatically. See `s3-metrics.sh` for the exact CLI commands.
11+
12+
## Step 2: Getting bucket metrics (request count)
13+
14+
The script handles this step automatically. See `s3-metrics.sh` for the exact CLI commands.
15+

tuts/209-s3-list-buckets/README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# S3 List Buckets
2+
3+
A read-only script that queries S3Api resources and displays information.
4+
5+
## Running
6+
7+
```bash
8+
bash s3-list-buckets.sh
9+
```
10+
11+
## What it does
12+
13+
1. Listing all buckets
14+
2. Bucket count"; echo " Total: $(aws s3api list-buckets --query 'Buckets | length(@)' --output text) buckets
15+
3. Checking public access block"; B=$(aws s3api list-buckets --query 'Buckets[0].Name' --output text); [ -n "$B" ] && [ "$B" != "None" ] && aws s3api get-public-access-block --bucket "$B" --query 'PublicAccessBlockConfiguration' --output table 2>/dev/null || echo " No public access block
16+
17+
## Resources created
18+
19+
None — this script is read-only.
20+
21+
## Cost
22+
23+
No cost. This script only reads existing resources.
24+
25+
## Related docs
26+
27+
- [AWS CLI s3api reference](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html)
28+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# S3 List Buckets
2+
3+
## Prerequisites
4+
5+
1. AWS CLI installed and configured (`aws configure`)
6+
2. Appropriate IAM permissions for the AWS services used
7+
8+
## Step 1: Listing all buckets
9+
10+
The script handles this step automatically. See `s3-list-buckets.sh` for the exact CLI commands.
11+
12+
## Step 2: Bucket count"; echo " Total: $(aws s3api list-buckets --query 'Buckets | length(@)' --output text) buckets
13+
14+
The script handles this step automatically. See `s3-list-buckets.sh` for the exact CLI commands.
15+
16+
## Step 3: Checking public access block"; B=$(aws s3api list-buckets --query 'Buckets[0].Name' --output text); [ -n "$B" ] && [ "$B" != "None" ] && aws s3api get-public-access-block --bucket "$B" --query 'PublicAccessBlockConfiguration' --output table 2>/dev/null || echo " No public access block
17+
18+
The script handles this step automatically. See `s3-list-buckets.sh` for the exact CLI commands.
19+
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# S3 Bucket Tagging
2+
3+
An AWS CLI tutorial that demonstrates S3 operations.
4+
5+
## Running
6+
7+
```bash
8+
bash s3-bucket-tagging.sh
9+
```
10+
11+
To auto-run with cleanup:
12+
13+
```bash
14+
echo 'y' | bash s3-bucket-tagging.sh
15+
```
16+
17+
## What it does
18+
19+
1. Creating bucket"; aws s3api create-bucket --bucket "$B
20+
2. Adding tags"; aws s3api put-bucket-tagging --bucket "$B
21+
3. Getting tags"; aws s3api get-bucket-tagging --bucket "$B
22+
4. Deleting tags"; aws s3api delete-bucket-tagging --bucket "$B"; echo " Tags deleted
23+
24+
## Resources created
25+
26+
- Bucket
27+
- Bucket Tagging
28+
29+
The script prompts you to clean up resources when it finishes.
30+
31+
## Cost
32+
33+
Free tier eligible for most operations. Clean up resources after use to avoid charges.
34+
35+
## Related docs
36+
37+
- [AWS CLI s3 reference](https://docs.aws.amazon.com/cli/latest/reference/s3/index.html)
38+
- [AWS CLI s3api reference](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html)
39+
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# S3 Bucket Tagging
2+
3+
## Prerequisites
4+
5+
1. AWS CLI installed and configured (`aws configure`)
6+
2. Appropriate IAM permissions for the AWS services used
7+
8+
## Step 1: Creating bucket"; aws s3api create-bucket --bucket "$B
9+
10+
The script handles this step automatically. See `s3-bucket-tagging.sh` for the exact CLI commands.
11+
12+
## Step 2: Adding tags"; aws s3api put-bucket-tagging --bucket "$B
13+
14+
The script handles this step automatically. See `s3-bucket-tagging.sh` for the exact CLI commands.
15+
16+
## Step 3: Getting tags"; aws s3api get-bucket-tagging --bucket "$B
17+
18+
The script handles this step automatically. See `s3-bucket-tagging.sh` for the exact CLI commands.
19+
20+
## Step 4: Deleting tags"; aws s3api delete-bucket-tagging --bucket "$B"; echo " Tags deleted
21+
22+
The script handles this step automatically. See `s3-bucket-tagging.sh` for the exact CLI commands.
23+
24+
## Cleanup
25+
26+
The script prompts you to clean up all created resources. If you need to clean up manually, check the script log for the resource names that were created.
27+

0 commit comments

Comments
 (0)