Skip to content

Commit 62e3fe2

Browse files
committed
Apply technical requirements (R1, R2, R9, R10, R13)
- R1: Add AWS_REGION to region fallback chain - R2: Replace openssl rand with /dev/urandom - R9: Remove Appendix/Generation details from READMEs - R10: Remove internal references - R13: Add REVISION-HISTORY.md
1 parent 20ee044 commit 62e3fe2

11 files changed

Lines changed: 49 additions & 21 deletions

File tree

tuts/107-amazon-efs-gs/README.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,3 @@ Per-GB pricing. $0.30/GB-month (Standard), $0.025/GB-month (Infrequent Access).
4141
- [Creating file systems](https://docs.aws.amazon.com/efs/latest/ug/creating-using-create-fs.html)
4242
- [Creating mount targets](https://docs.aws.amazon.com/efs/latest/ug/accessing-fs.html)
4343
- [EFS lifecycle management](https://docs.aws.amazon.com/efs/latest/ug/lifecycle-management-efs.html)
44-
45-
---
46-
47-
## Appendix: Generation details
48-
49-
| Field | Value |
50-
|-------|-------|
51-
| Generation date | 2026-04-14 |
52-
| Source script | New, 117 lines |
53-
| Script test result | EXIT 0, 114s, 7 steps, no issues |
54-
| Issues encountered | Mount target deletion wait increased to 120s |
55-
| Iterations | v1 (direct to publish) |
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Revision History: 107-amazon-efs-gs
2+
3+
## Shell (CLI script)
4+
5+
### 2026-04-14 v1 published
6+
- Type: functional
7+
- Initial version
8+

tuts/107-amazon-efs-gs/amazon-efs-gs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ fi
1414
export AWS_DEFAULT_REGION="$REGION"
1515
echo "Region: $REGION"
1616

17-
RANDOM_ID=$(openssl rand -hex 4)
17+
RANDOM_ID=$(cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 8 | head -n 1)
1818
FS_TOKEN="tut-efs-${RANDOM_ID}"
1919

2020
handle_error() { echo "ERROR on line $1"; trap - ERR; cleanup; exit 1; }
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Revision History: 127-amazon-glacier-gs
2+
3+
## Shell (CLI script)
4+
5+
### 2026-04-14 v1 published
6+
- Type: functional
7+
- Initial version
8+

tuts/127-amazon-glacier-gs/amazon-glacier-gs.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/bin/bash
22
WORK_DIR=$(mktemp -d)
33
exec > >(tee -a "$WORK_DIR/glacier-$(date +%Y%m%d-%H%M%S).log") 2>&1
4-
REGION=${AWS_DEFAULT_REGION:-$(aws configure get region 2>/dev/null)}
4+
REGION=${AWS_DEFAULT_REGION:-${AWS_REGION:-$(aws configure get region 2>/dev/null))}
55
[ -z "$REGION" ] && echo "ERROR: No region" && exit 1
66
export AWS_DEFAULT_REGION="$REGION"
77
echo "Region: $REGION"
8-
RANDOM_ID=$(openssl rand -hex 4)
8+
RANDOM_ID=$(cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 8 | head -n 1)
99
VAULT_NAME="tut-vault-${RANDOM_ID}"
1010
handle_error() { echo "ERROR on line $1"; trap - ERR; cleanup; exit 1; }
1111
trap 'handle_error $LINENO' ERR
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Revision History: 156-s3-event-notifications
2+
3+
## Shell (CLI script)
4+
5+
### 2026-04-14 v1 published
6+
- Type: functional
7+
- Initial version
8+

tuts/156-s3-event-notifications/s3-events.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
WORK_DIR=$(mktemp -d); exec > >(tee -a "$WORK_DIR/s3-events.log") 2>&1
3-
REGION=${AWS_DEFAULT_REGION:-$(aws configure get region 2>/dev/null)}; [ -z "$REGION" ] && echo "ERROR: No region" && exit 1; export AWS_DEFAULT_REGION="$REGION"; ACCOUNT=$(aws sts get-caller-identity --query 'Account' --output text); echo "Region: $REGION"
4-
RANDOM_ID=$(openssl rand -hex 4); BUCKET="s3-events-tut-${RANDOM_ID}-${ACCOUNT}"; QUEUE="s3-events-tut-${RANDOM_ID}"
3+
REGION=${AWS_DEFAULT_REGION:-${AWS_REGION:-$(aws configure get region 2>/dev/null))}; [ -z "$REGION" ] && echo "ERROR: No region" && exit 1; export AWS_DEFAULT_REGION="$REGION"; ACCOUNT=$(aws sts get-caller-identity --query 'Account' --output text); echo "Region: $REGION"
4+
RANDOM_ID=$(cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 8 | head -n 1); BUCKET="s3-events-tut-${RANDOM_ID}-${ACCOUNT}"; QUEUE="s3-events-tut-${RANDOM_ID}"
55
handle_error() { echo "ERROR on line $1"; trap - ERR; cleanup; exit 1; }; trap 'handle_error $LINENO' ERR
66
cleanup() { echo ""; echo "Cleaning up..."; aws s3 rm "s3://$BUCKET" --recursive --quiet 2>/dev/null; aws s3 rb "s3://$BUCKET" 2>/dev/null && echo " Deleted bucket"; [ -n "$QUEUE_URL" ] && aws sqs delete-queue --queue-url "$QUEUE_URL" 2>/dev/null && echo " Deleted queue"; rm -rf "$WORK_DIR"; echo "Done."; }
77
echo "Step 1: Creating SQS queue for notifications"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Revision History: 167-s3-presigned-urls
2+
3+
## Shell (CLI script)
4+
5+
### 2026-04-14 v1 published
6+
- Type: functional
7+
- Initial version
8+

tuts/167-s3-presigned-urls/s3-presigned.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
WORK_DIR=$(mktemp -d); exec > >(tee -a "$WORK_DIR/presign.log") 2>&1
3-
REGION=${AWS_DEFAULT_REGION:-$(aws configure get region 2>/dev/null)}; [ -z "$REGION" ] && echo "ERROR: No region" && exit 1; export AWS_DEFAULT_REGION="$REGION"; ACCOUNT=$(aws sts get-caller-identity --query 'Account' --output text); echo "Region: $REGION"
4-
RANDOM_ID=$(openssl rand -hex 4); BUCKET="presign-tut-${RANDOM_ID}-${ACCOUNT}"
3+
REGION=${AWS_DEFAULT_REGION:-${AWS_REGION:-$(aws configure get region 2>/dev/null))}; [ -z "$REGION" ] && echo "ERROR: No region" && exit 1; export AWS_DEFAULT_REGION="$REGION"; ACCOUNT=$(aws sts get-caller-identity --query 'Account' --output text); echo "Region: $REGION"
4+
RANDOM_ID=$(cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 8 | head -n 1); BUCKET="presign-tut-${RANDOM_ID}-${ACCOUNT}"
55
handle_error() { echo "ERROR on line $1"; trap - ERR; cleanup; exit 1; }; trap 'handle_error $LINENO' ERR
66
cleanup() { echo ""; echo "Cleaning up..."; aws s3 rm "s3://$BUCKET" --recursive --quiet 2>/dev/null; aws s3 rb "s3://$BUCKET" 2>/dev/null && echo " Deleted bucket"; rm -rf "$WORK_DIR"; echo "Done."; }
77
echo "Step 1: Creating bucket"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Revision History: 171-s3-versioning
2+
3+
## Shell (CLI script)
4+
5+
### 2026-04-14 v1 published
6+
- Type: functional
7+
- Initial version
8+

0 commit comments

Comments
 (0)