Skip to content

Commit 88e07e8

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 e0ae46e commit 88e07e8

12 files changed

Lines changed: 48 additions & 32 deletions

File tree

tuts/096-aws-codecommit-gs/README.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,3 @@ CodeCommit is free for up to 5 active users per month (unlimited repositories).
5050
- [Working with branches](https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-create-branch.html)
5151
- [CodeCommit quotas](https://docs.aws.amazon.com/codecommit/latest/userguide/limits.html)
5252
- [CodeCommit pricing](https://aws.amazon.com/codecommit/pricing/)
53-
54-
---
55-
56-
## Appendix: Generation details
57-
58-
| Field | Value |
59-
|-------|-------|
60-
| Generation date | 2026-04-14 |
61-
| Source script | New, 100 lines |
62-
| Script test result | EXIT 0, 11s, 7 steps, no issues |
63-
| Issues encountered | file-content needs fileb:// not inline string (fixed) |
64-
| Iterations | v1 |
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Revision History: 096-aws-codecommit-gs
2+
3+
## Shell (CLI script)
4+
5+
### 2026-04-14 v1 published
6+
- Type: functional
7+
- Initial version
8+

tuts/096-aws-codecommit-gs/aws-codecommit-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
REPO_NAME="tutorial-repo-${RANDOM_ID}"
1919

2020
handle_error() { echo "ERROR on line $1"; trap - ERR; cleanup; exit 1; }

tuts/098-aws-codebuild-gs/README.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,3 @@ CodeBuild free tier includes 100 build minutes per month on general1.small. No c
5151
- [Build specification reference](https://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html)
5252
- [Build environment reference](https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref.html)
5353
- [CodeBuild pricing](https://aws.amazon.com/codebuild/pricing/)
54-
55-
---
56-
57-
## Appendix: Generation details
58-
59-
| Field | Value |
60-
|-------|-------|
61-
| Generation date | 2026-04-14 |
62-
| Source script | New, 138 lines |
63-
| Script test result | EXIT 0, 37s, 6 steps, no issues |
64-
| Issues encountered | None |
65-
| Iterations | v1 |
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Revision History: 098-aws-codebuild-gs
2+
3+
## Shell (CLI script)
4+
5+
### 2026-04-14 v1 published
6+
- Type: functional
7+
- Initial version
8+

tuts/098-aws-codebuild-gs/aws-codebuild-gs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export AWS_DEFAULT_REGION="$REGION"
1515
ACCOUNT_ID=$(aws sts get-caller-identity --query 'Account' --output text)
1616
echo "Region: $REGION"
1717

18-
RANDOM_ID=$(openssl rand -hex 4)
18+
RANDOM_ID=$(cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 8 | head -n 1)
1919
BUCKET_NAME="codebuild-tut-${RANDOM_ID}-${ACCOUNT_ID}"
2020
PROJECT_NAME="tut-build-${RANDOM_ID}"
2121
ROLE_NAME="codebuild-tut-role-${RANDOM_ID}"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Revision History: 125-aws-codeartifact-gs
2+
3+
## Shell (CLI script)
4+
5+
### 2026-04-14 v1 published
6+
- Type: functional
7+
- Initial version
8+

tuts/125-aws-codeartifact-gs/aws-codeartifact-gs.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#!/bin/bash
22
WORK_DIR=$(mktemp -d)
33
exec > >(tee -a "$WORK_DIR/codeartifact-$(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
ACCOUNT=$(aws sts get-caller-identity --query 'Account' --output text)
88
echo "Region: $REGION"
9-
RANDOM_ID=$(openssl rand -hex 4)
9+
RANDOM_ID=$(cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 8 | head -n 1)
1010
DOMAIN="tut-domain-${RANDOM_ID}"
1111
REPO="tut-repo-${RANDOM_ID}"
1212
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: 135-aws-codedeploy-gs
2+
3+
## Shell (CLI script)
4+
5+
### 2026-04-14 v1 published
6+
- Type: functional
7+
- Initial version
8+

tuts/135-aws-codedeploy-gs/aws-codedeploy-gs.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/codedeploy.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"; echo "Region: $REGION"
4-
RANDOM_ID=$(openssl rand -hex 4); APP_NAME="tut-app-${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"; echo "Region: $REGION"
4+
RANDOM_ID=$(cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 8 | head -n 1); APP_NAME="tut-app-${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 deploy delete-application --application-name "$APP_NAME" 2>/dev/null && echo " Deleted app"; rm -rf "$WORK_DIR"; echo "Done."; }
77
echo "Step 1: Creating application: $APP_NAME"

0 commit comments

Comments
 (0)