From a95c3c7b61c7b1c5389a5e671e59cfb7696ad307 Mon Sep 17 00:00:00 2001 From: Michael Wunderlich Date: Tue, 14 Apr 2026 16:35:01 +0000 Subject: [PATCH 1/3] Add mixed tutorials (batch 24) --- .../cloudwatch-anomaly-detection.sh | 16 ++++++++++++++++ .../cloudwatch-contributor-insights.sh | 12 ++++++++++++ .../cloudwatch-composite-alarms.sh | 17 +++++++++++++++++ .../dynamodb-list-tables.sh | 8 ++++++++ tuts/211-iam-list-users/iam-list-users.sh | 6 ++++++ 5 files changed, 59 insertions(+) create mode 100644 tuts/179-cloudwatch-anomaly-detection/cloudwatch-anomaly-detection.sh create mode 100644 tuts/189-cloudwatch-contributor-insights/cloudwatch-contributor-insights.sh create mode 100644 tuts/195-cloudwatch-composite-alarms/cloudwatch-composite-alarms.sh create mode 100644 tuts/210-dynamodb-list-tables/dynamodb-list-tables.sh create mode 100644 tuts/211-iam-list-users/iam-list-users.sh diff --git a/tuts/179-cloudwatch-anomaly-detection/cloudwatch-anomaly-detection.sh b/tuts/179-cloudwatch-anomaly-detection/cloudwatch-anomaly-detection.sh new file mode 100644 index 00000000..ee1af044 --- /dev/null +++ b/tuts/179-cloudwatch-anomaly-detection/cloudwatch-anomaly-detection.sh @@ -0,0 +1,16 @@ +#!/bin/bash +WORK_DIR=$(mktemp -d); exec > >(tee -a "$WORK_DIR/ad.log") 2>&1 +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" +RANDOM_ID=$(openssl rand -hex 4); NS="Tutorial/AD-${RANDOM_ID}"; ALARM="tut-ad-alarm-${RANDOM_ID}" +cleanup() { echo ""; echo "Cleaning up..."; aws cloudwatch delete-alarms --alarm-names "$ALARM" 2>/dev/null && echo " Deleted alarm"; aws cloudwatch delete-anomaly-detector --namespace "$NS" --metric-name Latency --stat Average 2>/dev/null && echo " Deleted detector"; rm -rf "$WORK_DIR"; echo "Done."; } +echo "Step 1: Publishing baseline metrics" +for i in $(seq 1 20); do aws cloudwatch put-metric-data --namespace "$NS" --metric-name Latency --value $((50 + RANDOM % 20)) --unit Milliseconds; done +echo " Published 20 data points" +echo "Step 2: Creating anomaly detector" +aws cloudwatch put-anomaly-detector --namespace "$NS" --metric-name Latency --stat Average 2>/dev/null && echo " Detector created" || echo " Detector creation pending" +echo "Step 3: Creating anomaly detection alarm" +aws cloudwatch put-metric-alarm --alarm-name "$ALARM" --namespace "$NS" --metric-name Latency --comparison-operator LessThanLowerOrGreaterThanUpperThreshold --evaluation-periods 1 --threshold-metric-id ad1 --metrics '[{"Id":"m1","MetricStat":{"Metric":{"Namespace":"'"$NS"'","MetricName":"Latency"},"Period":60,"Stat":"Average"},"ReturnData":true},{"Id":"ad1","Expression":"ANOMALY_DETECTION_BAND(m1,2)","ReturnData":true}]' 2>/dev/null && echo " Alarm created" || echo " Alarm creation requires more data" +echo "Step 4: Describing alarm" +aws cloudwatch describe-alarms --alarm-names "$ALARM" --query 'MetricAlarms[0].{Name:AlarmName,State:StateValue}' --output table 2>/dev/null || echo " No alarm" +echo ""; echo "Tutorial complete." +echo "Do you want to clean up? (y/n): "; read -r CHOICE; [[ "$CHOICE" =~ ^[Yy]$ ]] && cleanup diff --git a/tuts/189-cloudwatch-contributor-insights/cloudwatch-contributor-insights.sh b/tuts/189-cloudwatch-contributor-insights/cloudwatch-contributor-insights.sh new file mode 100644 index 00000000..a9ce3924 --- /dev/null +++ b/tuts/189-cloudwatch-contributor-insights/cloudwatch-contributor-insights.sh @@ -0,0 +1,12 @@ +#!/bin/bash +WORK_DIR=$(mktemp -d); exec > >(tee -a "$WORK_DIR/tut.log") 2>&1 +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" +echo "Step 1: Listing existing rules" +aws cloudwatch describe-insight-rules --query 'InsightRules[:5].{Name:Name,State:State}' --output table 2>/dev/null || echo " No insight rules" +echo "Step 2: Listing log groups for analysis" +aws logs describe-log-groups --limit 5 --query 'logGroups[].{Name:logGroupName,Stored:storedBytes}' --output table +echo "Step 3: Getting metric widget image (base64)" +aws cloudwatch get-metric-widget-image --metric-widget '{"metrics":[["AWS/EC2","CPUUtilization"]],"period":300,"stat":"Average","region":"us-east-1","title":"EC2 CPU"}' --query 'MetricWidgetImage' --output text | head -c 50 +echo "..." +echo ""; echo "Tutorial complete. No resources created — read-only." +rm -rf "$WORK_DIR" diff --git a/tuts/195-cloudwatch-composite-alarms/cloudwatch-composite-alarms.sh b/tuts/195-cloudwatch-composite-alarms/cloudwatch-composite-alarms.sh new file mode 100644 index 00000000..543cd2b0 --- /dev/null +++ b/tuts/195-cloudwatch-composite-alarms/cloudwatch-composite-alarms.sh @@ -0,0 +1,17 @@ +#!/bin/bash +WORK_DIR=$(mktemp -d); exec > >(tee -a "$WORK_DIR/tut.log") 2>&1 +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" +RANDOM_ID=$(openssl rand -hex 4); NS="Tutorial/Comp-${RANDOM_ID}"; A1="tut-cpu-${RANDOM_ID}"; A2="tut-mem-${RANDOM_ID}"; COMP="tut-composite-${RANDOM_ID}" +cleanup() { echo "Cleaning up..."; aws cloudwatch delete-alarms --alarm-names "$COMP" "$A1" "$A2" 2>/dev/null && echo " Deleted alarms"; rm -rf "$WORK_DIR"; echo "Done."; } +echo "Step 1: Publishing metrics" +for i in $(seq 1 5); do aws cloudwatch put-metric-data --namespace "$NS" --metric-data "[{\"MetricName\":\"CPU\",\"Value\":$((RANDOM%100)),\"Unit\":\"Percent\"},{\"MetricName\":\"Memory\",\"Value\":$((RANDOM%100)),\"Unit\":\"Percent\"}]"; done +echo "Step 2: Creating metric alarms" +aws cloudwatch put-metric-alarm --alarm-name "$A1" --namespace "$NS" --metric-name CPU --statistic Average --period 60 --threshold 80 --comparison-operator GreaterThanThreshold --evaluation-periods 1 +aws cloudwatch put-metric-alarm --alarm-name "$A2" --namespace "$NS" --metric-name Memory --statistic Average --period 60 --threshold 80 --comparison-operator GreaterThanThreshold --evaluation-periods 1 +echo "Step 3: Creating composite alarm" +aws cloudwatch put-composite-alarm --alarm-name "$COMP" --alarm-rule "ALARM(\"$A1\") AND ALARM(\"$A2\")" +echo " Composite alarm triggers when BOTH CPU and Memory are high" +echo "Step 4: Describing composite alarm" +aws cloudwatch describe-alarms --alarm-names "$COMP" --alarm-types CompositeAlarm --query 'CompositeAlarms[0].{Name:AlarmName,Rule:AlarmRule,State:StateValue}' --output table +echo ""; echo "Tutorial complete." +echo "Do you want to clean up? (y/n): "; read -r C; [[ "$C" =~ ^[Yy]$ ]] && cleanup diff --git a/tuts/210-dynamodb-list-tables/dynamodb-list-tables.sh b/tuts/210-dynamodb-list-tables/dynamodb-list-tables.sh new file mode 100644 index 00000000..37d9bd00 --- /dev/null +++ b/tuts/210-dynamodb-list-tables/dynamodb-list-tables.sh @@ -0,0 +1,8 @@ +#!/bin/bash +WORK_DIR=$(mktemp -d); exec > >(tee -a "$WORK_DIR/tut.log") 2>&1 +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" +echo "Step 1: Listing tables"; aws dynamodb list-tables --query 'TableNames' --output table +echo "Step 2: Table details" +T=$(aws dynamodb list-tables --query 'TableNames[0]' --output text 2>/dev/null) +[ -n "$T" ] && [ "$T" != "None" ] && aws dynamodb describe-table --table-name "$T" --query 'Table.{Name:TableName,Status:TableStatus,Items:ItemCount,Size:TableSizeBytes,Billing:BillingModeSummary.BillingMode}' --output table || echo " No tables" +echo ""; echo "Tutorial complete. Read-only."; rm -rf "$WORK_DIR" diff --git a/tuts/211-iam-list-users/iam-list-users.sh b/tuts/211-iam-list-users/iam-list-users.sh new file mode 100644 index 00000000..54cf1be1 --- /dev/null +++ b/tuts/211-iam-list-users/iam-list-users.sh @@ -0,0 +1,6 @@ +#!/bin/bash +WORK_DIR=$(mktemp -d); exec > >(tee -a "$WORK_DIR/tut.log") 2>&1 +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" +echo "Step 1: Listing IAM users"; aws iam list-users --query 'Users[].{Name:UserName,Created:CreateDate,PasswordLastUsed:PasswordLastUsed}' --output table +echo "Step 2: User count"; echo " Total: $(aws iam list-users --query 'Users | length(@)' --output text) users" +echo ""; echo "Tutorial complete. Read-only."; rm -rf "$WORK_DIR" From ff07c359600f4c94297a8e389d747d4130d63042 Mon Sep 17 00:00:00 2001 From: Michael Wunderlich Date: Tue, 21 Apr 2026 05:17:16 +0000 Subject: [PATCH 2/3] 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 --- tuts/179-cloudwatch-anomaly-detection/REVISION-HISTORY.md | 8 ++++++++ .../cloudwatch-anomaly-detection.sh | 4 ++-- .../REVISION-HISTORY.md | 8 ++++++++ .../cloudwatch-contributor-insights.sh | 2 +- tuts/195-cloudwatch-composite-alarms/REVISION-HISTORY.md | 8 ++++++++ .../cloudwatch-composite-alarms.sh | 4 ++-- tuts/210-dynamodb-list-tables/REVISION-HISTORY.md | 8 ++++++++ tuts/210-dynamodb-list-tables/dynamodb-list-tables.sh | 2 +- tuts/211-iam-list-users/REVISION-HISTORY.md | 8 ++++++++ tuts/211-iam-list-users/iam-list-users.sh | 2 +- 10 files changed, 47 insertions(+), 7 deletions(-) create mode 100644 tuts/179-cloudwatch-anomaly-detection/REVISION-HISTORY.md create mode 100644 tuts/189-cloudwatch-contributor-insights/REVISION-HISTORY.md create mode 100644 tuts/195-cloudwatch-composite-alarms/REVISION-HISTORY.md create mode 100644 tuts/210-dynamodb-list-tables/REVISION-HISTORY.md create mode 100644 tuts/211-iam-list-users/REVISION-HISTORY.md diff --git a/tuts/179-cloudwatch-anomaly-detection/REVISION-HISTORY.md b/tuts/179-cloudwatch-anomaly-detection/REVISION-HISTORY.md new file mode 100644 index 00000000..28b803b4 --- /dev/null +++ b/tuts/179-cloudwatch-anomaly-detection/REVISION-HISTORY.md @@ -0,0 +1,8 @@ +# Revision History: 179-cloudwatch-anomaly-detection + +## Shell (CLI script) + +### 2026-04-14 v1 published +- Type: functional +- Initial version + diff --git a/tuts/179-cloudwatch-anomaly-detection/cloudwatch-anomaly-detection.sh b/tuts/179-cloudwatch-anomaly-detection/cloudwatch-anomaly-detection.sh index ee1af044..f18de3c7 100644 --- a/tuts/179-cloudwatch-anomaly-detection/cloudwatch-anomaly-detection.sh +++ b/tuts/179-cloudwatch-anomaly-detection/cloudwatch-anomaly-detection.sh @@ -1,7 +1,7 @@ #!/bin/bash WORK_DIR=$(mktemp -d); exec > >(tee -a "$WORK_DIR/ad.log") 2>&1 -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" -RANDOM_ID=$(openssl rand -hex 4); NS="Tutorial/AD-${RANDOM_ID}"; ALARM="tut-ad-alarm-${RANDOM_ID}" +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" +RANDOM_ID=$(cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 8 | head -n 1); NS="Tutorial/AD-${RANDOM_ID}"; ALARM="tut-ad-alarm-${RANDOM_ID}" cleanup() { echo ""; echo "Cleaning up..."; aws cloudwatch delete-alarms --alarm-names "$ALARM" 2>/dev/null && echo " Deleted alarm"; aws cloudwatch delete-anomaly-detector --namespace "$NS" --metric-name Latency --stat Average 2>/dev/null && echo " Deleted detector"; rm -rf "$WORK_DIR"; echo "Done."; } echo "Step 1: Publishing baseline metrics" for i in $(seq 1 20); do aws cloudwatch put-metric-data --namespace "$NS" --metric-name Latency --value $((50 + RANDOM % 20)) --unit Milliseconds; done diff --git a/tuts/189-cloudwatch-contributor-insights/REVISION-HISTORY.md b/tuts/189-cloudwatch-contributor-insights/REVISION-HISTORY.md new file mode 100644 index 00000000..ce4224e8 --- /dev/null +++ b/tuts/189-cloudwatch-contributor-insights/REVISION-HISTORY.md @@ -0,0 +1,8 @@ +# Revision History: 189-cloudwatch-contributor-insights + +## Shell (CLI script) + +### 2026-04-14 v1 published +- Type: functional +- Initial version + diff --git a/tuts/189-cloudwatch-contributor-insights/cloudwatch-contributor-insights.sh b/tuts/189-cloudwatch-contributor-insights/cloudwatch-contributor-insights.sh index a9ce3924..a8e419f7 100644 --- a/tuts/189-cloudwatch-contributor-insights/cloudwatch-contributor-insights.sh +++ b/tuts/189-cloudwatch-contributor-insights/cloudwatch-contributor-insights.sh @@ -1,6 +1,6 @@ #!/bin/bash WORK_DIR=$(mktemp -d); exec > >(tee -a "$WORK_DIR/tut.log") 2>&1 -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" +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" echo "Step 1: Listing existing rules" aws cloudwatch describe-insight-rules --query 'InsightRules[:5].{Name:Name,State:State}' --output table 2>/dev/null || echo " No insight rules" echo "Step 2: Listing log groups for analysis" diff --git a/tuts/195-cloudwatch-composite-alarms/REVISION-HISTORY.md b/tuts/195-cloudwatch-composite-alarms/REVISION-HISTORY.md new file mode 100644 index 00000000..bc9de0d6 --- /dev/null +++ b/tuts/195-cloudwatch-composite-alarms/REVISION-HISTORY.md @@ -0,0 +1,8 @@ +# Revision History: 195-cloudwatch-composite-alarms + +## Shell (CLI script) + +### 2026-04-14 v1 published +- Type: functional +- Initial version + diff --git a/tuts/195-cloudwatch-composite-alarms/cloudwatch-composite-alarms.sh b/tuts/195-cloudwatch-composite-alarms/cloudwatch-composite-alarms.sh index 543cd2b0..af06c0f6 100644 --- a/tuts/195-cloudwatch-composite-alarms/cloudwatch-composite-alarms.sh +++ b/tuts/195-cloudwatch-composite-alarms/cloudwatch-composite-alarms.sh @@ -1,7 +1,7 @@ #!/bin/bash WORK_DIR=$(mktemp -d); exec > >(tee -a "$WORK_DIR/tut.log") 2>&1 -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" -RANDOM_ID=$(openssl rand -hex 4); NS="Tutorial/Comp-${RANDOM_ID}"; A1="tut-cpu-${RANDOM_ID}"; A2="tut-mem-${RANDOM_ID}"; COMP="tut-composite-${RANDOM_ID}" +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" +RANDOM_ID=$(cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 8 | head -n 1); NS="Tutorial/Comp-${RANDOM_ID}"; A1="tut-cpu-${RANDOM_ID}"; A2="tut-mem-${RANDOM_ID}"; COMP="tut-composite-${RANDOM_ID}" cleanup() { echo "Cleaning up..."; aws cloudwatch delete-alarms --alarm-names "$COMP" "$A1" "$A2" 2>/dev/null && echo " Deleted alarms"; rm -rf "$WORK_DIR"; echo "Done."; } echo "Step 1: Publishing metrics" for i in $(seq 1 5); do aws cloudwatch put-metric-data --namespace "$NS" --metric-data "[{\"MetricName\":\"CPU\",\"Value\":$((RANDOM%100)),\"Unit\":\"Percent\"},{\"MetricName\":\"Memory\",\"Value\":$((RANDOM%100)),\"Unit\":\"Percent\"}]"; done diff --git a/tuts/210-dynamodb-list-tables/REVISION-HISTORY.md b/tuts/210-dynamodb-list-tables/REVISION-HISTORY.md new file mode 100644 index 00000000..d163e5d5 --- /dev/null +++ b/tuts/210-dynamodb-list-tables/REVISION-HISTORY.md @@ -0,0 +1,8 @@ +# Revision History: 210-dynamodb-list-tables + +## Shell (CLI script) + +### 2026-04-14 v1 published +- Type: functional +- Initial version + diff --git a/tuts/210-dynamodb-list-tables/dynamodb-list-tables.sh b/tuts/210-dynamodb-list-tables/dynamodb-list-tables.sh index 37d9bd00..2d164bc8 100644 --- a/tuts/210-dynamodb-list-tables/dynamodb-list-tables.sh +++ b/tuts/210-dynamodb-list-tables/dynamodb-list-tables.sh @@ -1,6 +1,6 @@ #!/bin/bash WORK_DIR=$(mktemp -d); exec > >(tee -a "$WORK_DIR/tut.log") 2>&1 -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" +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" echo "Step 1: Listing tables"; aws dynamodb list-tables --query 'TableNames' --output table echo "Step 2: Table details" T=$(aws dynamodb list-tables --query 'TableNames[0]' --output text 2>/dev/null) diff --git a/tuts/211-iam-list-users/REVISION-HISTORY.md b/tuts/211-iam-list-users/REVISION-HISTORY.md new file mode 100644 index 00000000..46061925 --- /dev/null +++ b/tuts/211-iam-list-users/REVISION-HISTORY.md @@ -0,0 +1,8 @@ +# Revision History: 211-iam-list-users + +## Shell (CLI script) + +### 2026-04-14 v1 published +- Type: functional +- Initial version + diff --git a/tuts/211-iam-list-users/iam-list-users.sh b/tuts/211-iam-list-users/iam-list-users.sh index 54cf1be1..e819faef 100644 --- a/tuts/211-iam-list-users/iam-list-users.sh +++ b/tuts/211-iam-list-users/iam-list-users.sh @@ -1,6 +1,6 @@ #!/bin/bash WORK_DIR=$(mktemp -d); exec > >(tee -a "$WORK_DIR/tut.log") 2>&1 -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" +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" echo "Step 1: Listing IAM users"; aws iam list-users --query 'Users[].{Name:UserName,Created:CreateDate,PasswordLastUsed:PasswordLastUsed}' --output table echo "Step 2: User count"; echo " Total: $(aws iam list-users --query 'Users | length(@)' --output text) users" echo ""; echo "Tutorial complete. Read-only."; rm -rf "$WORK_DIR" From d9b6755d88c552b691946bd3b17aae11a29280f9 Mon Sep 17 00:00:00 2001 From: Michael Wunderlich Date: Tue, 21 Apr 2026 05:38:01 +0000 Subject: [PATCH 3/3] Add README.md and tutorial walkthrough for script-only tutorials --- .../README.md | 39 +++++++++++++++++++ .../cloudwatch-anomaly-detection.md | 27 +++++++++++++ .../README.md | 29 ++++++++++++++ .../cloudwatch-contributor-insights.md | 19 +++++++++ .../195-cloudwatch-composite-alarms/README.md | 39 +++++++++++++++++++ .../cloudwatch-composite-alarms.md | 27 +++++++++++++ tuts/210-dynamodb-list-tables/README.md | 27 +++++++++++++ .../dynamodb-list-tables.md | 15 +++++++ tuts/211-iam-list-users/README.md | 27 +++++++++++++ tuts/211-iam-list-users/iam-list-users.md | 15 +++++++ 10 files changed, 264 insertions(+) create mode 100644 tuts/179-cloudwatch-anomaly-detection/README.md create mode 100644 tuts/179-cloudwatch-anomaly-detection/cloudwatch-anomaly-detection.md create mode 100644 tuts/189-cloudwatch-contributor-insights/README.md create mode 100644 tuts/189-cloudwatch-contributor-insights/cloudwatch-contributor-insights.md create mode 100644 tuts/195-cloudwatch-composite-alarms/README.md create mode 100644 tuts/195-cloudwatch-composite-alarms/cloudwatch-composite-alarms.md create mode 100644 tuts/210-dynamodb-list-tables/README.md create mode 100644 tuts/210-dynamodb-list-tables/dynamodb-list-tables.md create mode 100644 tuts/211-iam-list-users/README.md create mode 100644 tuts/211-iam-list-users/iam-list-users.md diff --git a/tuts/179-cloudwatch-anomaly-detection/README.md b/tuts/179-cloudwatch-anomaly-detection/README.md new file mode 100644 index 00000000..7e134163 --- /dev/null +++ b/tuts/179-cloudwatch-anomaly-detection/README.md @@ -0,0 +1,39 @@ +# Cloudwatch Anomaly Detection + +An AWS CLI tutorial that demonstrates Cloudwatch operations. + +## Running + +```bash +bash cloudwatch-anomaly-detection.sh +``` + +To auto-run with cleanup: + +```bash +echo 'y' | bash cloudwatch-anomaly-detection.sh +``` + +## What it does + +1. Publishing baseline metrics +2. Creating anomaly detector +3. Creating anomaly detection alarm +4. Describing alarm + +## Resources created + +- Anomaly Detector +- Metric Alarm +- Metric Data + +The script prompts you to clean up resources when it finishes. + +## Cost + +Free tier eligible for most operations. Clean up resources after use to avoid charges. + +## Related docs + +- [AWS CLI cloudwatch reference](https://docs.aws.amazon.com/cli/latest/reference/cloudwatch/index.html) + diff --git a/tuts/179-cloudwatch-anomaly-detection/cloudwatch-anomaly-detection.md b/tuts/179-cloudwatch-anomaly-detection/cloudwatch-anomaly-detection.md new file mode 100644 index 00000000..535e8905 --- /dev/null +++ b/tuts/179-cloudwatch-anomaly-detection/cloudwatch-anomaly-detection.md @@ -0,0 +1,27 @@ +# Cloudwatch Anomaly Detection + +## Prerequisites + +1. AWS CLI installed and configured (`aws configure`) +2. Appropriate IAM permissions for the AWS services used + +## Step 1: Publishing baseline metrics + +The script handles this step automatically. See `cloudwatch-anomaly-detection.sh` for the exact CLI commands. + +## Step 2: Creating anomaly detector + +The script handles this step automatically. See `cloudwatch-anomaly-detection.sh` for the exact CLI commands. + +## Step 3: Creating anomaly detection alarm + +The script handles this step automatically. See `cloudwatch-anomaly-detection.sh` for the exact CLI commands. + +## Step 4: Describing alarm + +The script handles this step automatically. See `cloudwatch-anomaly-detection.sh` for the exact CLI commands. + +## Cleanup + +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. + diff --git a/tuts/189-cloudwatch-contributor-insights/README.md b/tuts/189-cloudwatch-contributor-insights/README.md new file mode 100644 index 00000000..b6a73da7 --- /dev/null +++ b/tuts/189-cloudwatch-contributor-insights/README.md @@ -0,0 +1,29 @@ +# Cloudwatch Contributor Insights + +A read-only script that queries Cloudwatch resources and displays information. + +## Running + +```bash +bash cloudwatch-contributor-insights.sh +``` + +## What it does + +1. Listing existing rules +2. Listing log groups for analysis +3. Getting metric widget image (base64) + +## Resources created + +None — this script is read-only. + +## Cost + +No cost. This script only reads existing resources. + +## Related docs + +- [AWS CLI cloudwatch reference](https://docs.aws.amazon.com/cli/latest/reference/cloudwatch/index.html) +- [AWS CLI logs reference](https://docs.aws.amazon.com/cli/latest/reference/logs/index.html) + diff --git a/tuts/189-cloudwatch-contributor-insights/cloudwatch-contributor-insights.md b/tuts/189-cloudwatch-contributor-insights/cloudwatch-contributor-insights.md new file mode 100644 index 00000000..9d3c8ab5 --- /dev/null +++ b/tuts/189-cloudwatch-contributor-insights/cloudwatch-contributor-insights.md @@ -0,0 +1,19 @@ +# Cloudwatch Contributor Insights + +## Prerequisites + +1. AWS CLI installed and configured (`aws configure`) +2. Appropriate IAM permissions for the AWS services used + +## Step 1: Listing existing rules + +The script handles this step automatically. See `cloudwatch-contributor-insights.sh` for the exact CLI commands. + +## Step 2: Listing log groups for analysis + +The script handles this step automatically. See `cloudwatch-contributor-insights.sh` for the exact CLI commands. + +## Step 3: Getting metric widget image (base64) + +The script handles this step automatically. See `cloudwatch-contributor-insights.sh` for the exact CLI commands. + diff --git a/tuts/195-cloudwatch-composite-alarms/README.md b/tuts/195-cloudwatch-composite-alarms/README.md new file mode 100644 index 00000000..8a7f87fe --- /dev/null +++ b/tuts/195-cloudwatch-composite-alarms/README.md @@ -0,0 +1,39 @@ +# Cloudwatch Composite Alarms + +An AWS CLI tutorial that demonstrates Cloudwatch operations. + +## Running + +```bash +bash cloudwatch-composite-alarms.sh +``` + +To auto-run with cleanup: + +```bash +echo 'y' | bash cloudwatch-composite-alarms.sh +``` + +## What it does + +1. Publishing metrics +2. Creating metric alarms +3. Creating composite alarm +4. Describing composite alarm + +## Resources created + +- Composite Alarm +- Metric Alarm +- Metric Data + +The script prompts you to clean up resources when it finishes. + +## Cost + +Free tier eligible for most operations. Clean up resources after use to avoid charges. + +## Related docs + +- [AWS CLI cloudwatch reference](https://docs.aws.amazon.com/cli/latest/reference/cloudwatch/index.html) + diff --git a/tuts/195-cloudwatch-composite-alarms/cloudwatch-composite-alarms.md b/tuts/195-cloudwatch-composite-alarms/cloudwatch-composite-alarms.md new file mode 100644 index 00000000..67d0b737 --- /dev/null +++ b/tuts/195-cloudwatch-composite-alarms/cloudwatch-composite-alarms.md @@ -0,0 +1,27 @@ +# Cloudwatch Composite Alarms + +## Prerequisites + +1. AWS CLI installed and configured (`aws configure`) +2. Appropriate IAM permissions for the AWS services used + +## Step 1: Publishing metrics + +The script handles this step automatically. See `cloudwatch-composite-alarms.sh` for the exact CLI commands. + +## Step 2: Creating metric alarms + +The script handles this step automatically. See `cloudwatch-composite-alarms.sh` for the exact CLI commands. + +## Step 3: Creating composite alarm + +The script handles this step automatically. See `cloudwatch-composite-alarms.sh` for the exact CLI commands. + +## Step 4: Describing composite alarm + +The script handles this step automatically. See `cloudwatch-composite-alarms.sh` for the exact CLI commands. + +## Cleanup + +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. + diff --git a/tuts/210-dynamodb-list-tables/README.md b/tuts/210-dynamodb-list-tables/README.md new file mode 100644 index 00000000..66dc8ebd --- /dev/null +++ b/tuts/210-dynamodb-list-tables/README.md @@ -0,0 +1,27 @@ +# Dynamodb List Tables + +A read-only script that queries Dynamodb resources and displays information. + +## Running + +```bash +bash dynamodb-list-tables.sh +``` + +## What it does + +1. Listing tables +2. Table details + +## Resources created + +None — this script is read-only. + +## Cost + +No cost. This script only reads existing resources. + +## Related docs + +- [AWS CLI dynamodb reference](https://docs.aws.amazon.com/cli/latest/reference/dynamodb/index.html) + diff --git a/tuts/210-dynamodb-list-tables/dynamodb-list-tables.md b/tuts/210-dynamodb-list-tables/dynamodb-list-tables.md new file mode 100644 index 00000000..1ca56782 --- /dev/null +++ b/tuts/210-dynamodb-list-tables/dynamodb-list-tables.md @@ -0,0 +1,15 @@ +# Dynamodb List Tables + +## Prerequisites + +1. AWS CLI installed and configured (`aws configure`) +2. Appropriate IAM permissions for the AWS services used + +## Step 1: Listing tables + +The script handles this step automatically. See `dynamodb-list-tables.sh` for the exact CLI commands. + +## Step 2: Table details + +The script handles this step automatically. See `dynamodb-list-tables.sh` for the exact CLI commands. + diff --git a/tuts/211-iam-list-users/README.md b/tuts/211-iam-list-users/README.md new file mode 100644 index 00000000..098dfa5c --- /dev/null +++ b/tuts/211-iam-list-users/README.md @@ -0,0 +1,27 @@ +# Iam List Users + +A read-only script that queries Iam resources and displays information. + +## Running + +```bash +bash iam-list-users.sh +``` + +## What it does + +1. Listing IAM users +2. User count"; echo " Total: $(aws iam list-users --query 'Users | length(@)' --output text) users + +## Resources created + +None — this script is read-only. + +## Cost + +No cost. This script only reads existing resources. + +## Related docs + +- [AWS CLI iam reference](https://docs.aws.amazon.com/cli/latest/reference/iam/index.html) + diff --git a/tuts/211-iam-list-users/iam-list-users.md b/tuts/211-iam-list-users/iam-list-users.md new file mode 100644 index 00000000..564d4b93 --- /dev/null +++ b/tuts/211-iam-list-users/iam-list-users.md @@ -0,0 +1,15 @@ +# Iam List Users + +## Prerequisites + +1. AWS CLI installed and configured (`aws configure`) +2. Appropriate IAM permissions for the AWS services used + +## Step 1: Listing IAM users + +The script handles this step automatically. See `iam-list-users.sh` for the exact CLI commands. + +## Step 2: User count"; echo " Total: $(aws iam list-users --query 'Users | length(@)' --output text) users + +The script handles this step automatically. See `iam-list-users.sh` for the exact CLI commands. +