Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions tuts/197-ec2-describe-instances/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Ec2 Describe Instances

A read-only script that queries Ec2 resources and displays information.

## Running

```bash
bash ec2-describe-instances.sh
```

## What it does

1. Listing all instances"; aws ec2 describe-instances --query 'Reservations[].Instances[].{Id:InstanceId,Type:InstanceType,State:State.Name,Name:Tags[?Key==`Name`].Value|[0]}' --output table 2>/dev/null || echo " No instances
2. Counting by state

## Resources created

None — this script is read-only.

## Cost

No cost. This script only reads existing resources.

## Related docs

- [AWS CLI ec2 reference](https://docs.aws.amazon.com/cli/latest/reference/ec2/index.html)

8 changes: 8 additions & 0 deletions tuts/197-ec2-describe-instances/REVISION-HISTORY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Revision History: 197-ec2-describe-instances

## Shell (CLI script)

### 2026-04-14 v1 published
- Type: functional
- Initial version

15 changes: 15 additions & 0 deletions tuts/197-ec2-describe-instances/ec2-describe-instances.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Ec2 Describe Instances

## Prerequisites

1. AWS CLI installed and configured (`aws configure`)
2. Appropriate IAM permissions for the AWS services used

## Step 1: Listing all instances"; aws ec2 describe-instances --query 'Reservations[].Instances[].{Id:InstanceId,Type:InstanceType,State:State.Name,Name:Tags[?Key==`Name`].Value|[0]}' --output table 2>/dev/null || echo " No instances

The script handles this step automatically. See `ec2-describe-instances.sh` for the exact CLI commands.

## Step 2: Counting by state

The script handles this step automatically. See `ec2-describe-instances.sh` for the exact CLI commands.

6 changes: 6 additions & 0 deletions tuts/197-ec2-describe-instances/ec2-describe-instances.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
WORK_DIR=$(mktemp -d); exec > >(tee -a "$WORK_DIR/tut.log") 2>&1
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 all instances"; aws ec2 describe-instances --query 'Reservations[].Instances[].{Id:InstanceId,Type:InstanceType,State:State.Name,Name:Tags[?Key==`Name`].Value|[0]}' --output table 2>/dev/null || echo " No instances"
echo "Step 2: Counting by state"; aws ec2 describe-instances --query 'Reservations[].Instances[].State.Name' --output text | tr '\t' '\n' | sort | uniq -c
echo ""; echo "Tutorial complete. Read-only."; rm -rf "$WORK_DIR"
29 changes: 29 additions & 0 deletions tuts/200-ec2-vpc-subnets/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Ec2 Vpc Subnets

A read-only script that queries Ec2 resources and displays information.

## Running

```bash
bash ec2-vpc-subnets.sh
```

## What it does

1. Listing VPCs
2. Listing subnets
3. Listing route tables
4. Listing internet gateways

## Resources created

None — this script is read-only.

## Cost

No cost. This script only reads existing resources.

## Related docs

- [AWS CLI ec2 reference](https://docs.aws.amazon.com/cli/latest/reference/ec2/index.html)

8 changes: 8 additions & 0 deletions tuts/200-ec2-vpc-subnets/REVISION-HISTORY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Revision History: 200-ec2-vpc-subnets

## Shell (CLI script)

### 2026-04-14 v1 published
- Type: functional
- Initial version

23 changes: 23 additions & 0 deletions tuts/200-ec2-vpc-subnets/ec2-vpc-subnets.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Ec2 Vpc Subnets

## Prerequisites

1. AWS CLI installed and configured (`aws configure`)
2. Appropriate IAM permissions for the AWS services used

## Step 1: Listing VPCs

The script handles this step automatically. See `ec2-vpc-subnets.sh` for the exact CLI commands.

## Step 2: Listing subnets

The script handles this step automatically. See `ec2-vpc-subnets.sh` for the exact CLI commands.

## Step 3: Listing route tables

The script handles this step automatically. See `ec2-vpc-subnets.sh` for the exact CLI commands.

## Step 4: Listing internet gateways

The script handles this step automatically. See `ec2-vpc-subnets.sh` for the exact CLI commands.

8 changes: 8 additions & 0 deletions tuts/200-ec2-vpc-subnets/ec2-vpc-subnets.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
WORK_DIR=$(mktemp -d); exec > >(tee -a "$WORK_DIR/tut.log") 2>&1
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 VPCs"; aws ec2 describe-vpcs --query 'Vpcs[].{Id:VpcId,CIDR:CidrBlock,Default:IsDefault}' --output table
echo "Step 2: Listing subnets"; aws ec2 describe-subnets --query 'Subnets[:10].{Id:SubnetId,VPC:VpcId,AZ:AvailabilityZone,CIDR:CidrBlock}' --output table
echo "Step 3: Listing route tables"; aws ec2 describe-route-tables --query 'RouteTables[:5].{Id:RouteTableId,VPC:VpcId,Routes:Routes|length(@)}' --output table
echo "Step 4: Listing internet gateways"; aws ec2 describe-internet-gateways --query 'InternetGateways[:5].{Id:InternetGatewayId,VPC:Attachments[0].VpcId}' --output table
echo ""; echo "Tutorial complete. Read-only."; rm -rf "$WORK_DIR"
27 changes: 27 additions & 0 deletions tuts/201-lambda-logging/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Lambda Logging

A read-only script that queries Logs resources and displays information.

## Running

```bash
bash lambda-logging.sh
```

## What it does

1. Listing Lambda log groups
2. Getting recent log events from a function

## Resources created

None — this script is read-only.

## Cost

No cost. This script only reads existing resources.

## Related docs

- [AWS CLI logs reference](https://docs.aws.amazon.com/cli/latest/reference/logs/index.html)

8 changes: 8 additions & 0 deletions tuts/201-lambda-logging/REVISION-HISTORY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Revision History: 201-lambda-logging

## Shell (CLI script)

### 2026-04-14 v1 published
- Type: functional
- Initial version

15 changes: 15 additions & 0 deletions tuts/201-lambda-logging/lambda-logging.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Lambda Logging

## Prerequisites

1. AWS CLI installed and configured (`aws configure`)
2. Appropriate IAM permissions for the AWS services used

## Step 1: Listing Lambda log groups

The script handles this step automatically. See `lambda-logging.sh` for the exact CLI commands.

## Step 2: Getting recent log events from a function

The script handles this step automatically. See `lambda-logging.sh` for the exact CLI commands.

8 changes: 8 additions & 0 deletions tuts/201-lambda-logging/lambda-logging.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
WORK_DIR=$(mktemp -d); exec > >(tee -a "$WORK_DIR/tut.log") 2>&1
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 Lambda log groups"; aws logs describe-log-groups --log-group-name-prefix /aws/lambda --query 'logGroups[:10].{Name:logGroupName,Stored:storedBytes,Retention:retentionInDays}' --output table
echo "Step 2: Getting recent log events from a function"
LG=$(aws logs describe-log-groups --log-group-name-prefix /aws/lambda --query 'logGroups[0].logGroupName' --output text 2>/dev/null)
[ -n "$LG" ] && [ "$LG" != "None" ] && { LS=$(aws logs describe-log-streams --log-group-name "$LG" --order-by LastEventTime --descending --limit 1 --query 'logStreams[0].logStreamName' --output text); aws logs get-log-events --log-group-name "$LG" --log-stream-name "$LS" --limit 5 --query 'events[].message' --output text; } || echo " No Lambda log groups"
echo ""; echo "Tutorial complete. Read-only."; rm -rf "$WORK_DIR"
27 changes: 27 additions & 0 deletions tuts/204-ec2-network-interfaces/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Ec2 Network Interfaces

A read-only script that queries Ec2 resources and displays information.

## Running

```bash
bash ec2-network-interfaces.sh
```

## What it does

1. Listing network interfaces
2. Counting by type

## Resources created

None — this script is read-only.

## Cost

No cost. This script only reads existing resources.

## Related docs

- [AWS CLI ec2 reference](https://docs.aws.amazon.com/cli/latest/reference/ec2/index.html)

8 changes: 8 additions & 0 deletions tuts/204-ec2-network-interfaces/REVISION-HISTORY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Revision History: 204-ec2-network-interfaces

## Shell (CLI script)

### 2026-04-14 v1 published
- Type: functional
- Initial version

15 changes: 15 additions & 0 deletions tuts/204-ec2-network-interfaces/ec2-network-interfaces.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Ec2 Network Interfaces

## Prerequisites

1. AWS CLI installed and configured (`aws configure`)
2. Appropriate IAM permissions for the AWS services used

## Step 1: Listing network interfaces

The script handles this step automatically. See `ec2-network-interfaces.sh` for the exact CLI commands.

## Step 2: Counting by type

The script handles this step automatically. See `ec2-network-interfaces.sh` for the exact CLI commands.

6 changes: 6 additions & 0 deletions tuts/204-ec2-network-interfaces/ec2-network-interfaces.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
WORK_DIR=$(mktemp -d); exec > >(tee -a "$WORK_DIR/tut.log") 2>&1
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 network interfaces"; aws ec2 describe-network-interfaces --query 'NetworkInterfaces[:10].{Id:NetworkInterfaceId,Type:InterfaceType,Status:Status,SubnetId:SubnetId}' --output table
echo "Step 2: Counting by type"; aws ec2 describe-network-interfaces --query 'NetworkInterfaces[].InterfaceType' --output text | tr '\t' '\n' | sort | uniq -c | sort -rn
echo ""; echo "Tutorial complete. Read-only."; rm -rf "$WORK_DIR"
27 changes: 27 additions & 0 deletions tuts/207-ec2-volumes/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Ec2 Volumes

A read-only script that queries Ec2 resources and displays information.

## Running

```bash
bash ec2-volumes.sh
```

## What it does

1. Listing volumes
2. Volume summary"; echo " Total: $(aws ec2 describe-volumes --query 'Volumes | length(@)' --output text) volumes

## Resources created

None — this script is read-only.

## Cost

No cost. This script only reads existing resources.

## Related docs

- [AWS CLI ec2 reference](https://docs.aws.amazon.com/cli/latest/reference/ec2/index.html)

8 changes: 8 additions & 0 deletions tuts/207-ec2-volumes/REVISION-HISTORY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Revision History: 207-ec2-volumes

## Shell (CLI script)

### 2026-04-14 v1 published
- Type: functional
- Initial version

15 changes: 15 additions & 0 deletions tuts/207-ec2-volumes/ec2-volumes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Ec2 Volumes

## Prerequisites

1. AWS CLI installed and configured (`aws configure`)
2. Appropriate IAM permissions for the AWS services used

## Step 1: Listing volumes

The script handles this step automatically. See `ec2-volumes.sh` for the exact CLI commands.

## Step 2: Volume summary"; echo " Total: $(aws ec2 describe-volumes --query 'Volumes | length(@)' --output text) volumes

The script handles this step automatically. See `ec2-volumes.sh` for the exact CLI commands.

6 changes: 6 additions & 0 deletions tuts/207-ec2-volumes/ec2-volumes.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
WORK_DIR=$(mktemp -d); exec > >(tee -a "$WORK_DIR/tut.log") 2>&1
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 volumes"; aws ec2 describe-volumes --query 'Volumes[:10].{Id:VolumeId,Type:VolumeType,Size:Size,State:State,AZ:AvailabilityZone}' --output table
echo "Step 2: Volume summary"; echo " Total: $(aws ec2 describe-volumes --query 'Volumes | length(@)' --output text) volumes"
echo ""; echo "Tutorial complete. Read-only."; rm -rf "$WORK_DIR"
Loading