Skip to content

Commit 390f490

Browse files
committed
Add README.md and tutorial walkthrough for script-only tutorials
1 parent e18fa6e commit 390f490

10 files changed

Lines changed: 237 additions & 0 deletions

File tree

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Dynamodb Batch Ops
2+
3+
An AWS CLI tutorial that demonstrates Dynamodb operations.
4+
5+
## Running
6+
7+
```bash
8+
bash dynamodb-batch-ops.sh
9+
```
10+
11+
To auto-run with cleanup:
12+
13+
```bash
14+
echo 'y' | bash dynamodb-batch-ops.sh
15+
```
16+
17+
## What it does
18+
19+
1. Creating table"; aws dynamodb create-table --table-name "$T" --key-schema AttributeName=pk,KeyType=HASH --attribute-definitions AttributeName=pk,AttributeType=S --billing-mode PAY_PER_REQUEST > /dev/null; aws dynamodb wait table-exists --table-name "$T
20+
2. Batch write (25 items)"; aws dynamodb batch-write-item --request-items "{\"$T\":[$(for i in $(seq 1 25); do echo -n "{\"PutRequest\":{\"Item\":{\"pk\":{\"S\":\"item-$i\"},\"data\":{\"S\":\"value-$i\"}}}}"; [ $i -lt 25 ] && echo -n ","; done)]}
21+
3. Batch get (5 items)"; aws dynamodb batch-get-item --request-items "{\"$T\":{\"Keys\":[{\"pk\":{\"S\":\"item-1\"}},{\"pk\":{\"S\":\"item-5\"}},{\"pk\":{\"S\":\"item-10\"}},{\"pk\":{\"S\":\"item-15\"}},{\"pk\":{\"S\":\"item-20\"}}]}}" --query "Responses.\"$T\"[].{pk:pk.S,data:data.S}
22+
4. Scan count"; aws dynamodb scan --table-name "$T
23+
24+
## Resources created
25+
26+
- Table
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 dynamodb reference](https://docs.aws.amazon.com/cli/latest/reference/dynamodb/index.html)
37+
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Dynamodb Batch Ops
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 table"; aws dynamodb create-table --table-name "$T" --key-schema AttributeName=pk,KeyType=HASH --attribute-definitions AttributeName=pk,AttributeType=S --billing-mode PAY_PER_REQUEST > /dev/null; aws dynamodb wait table-exists --table-name "$T
9+
10+
The script handles this step automatically. See `dynamodb-batch-ops.sh` for the exact CLI commands.
11+
12+
## Step 2: Batch write (25 items)"; aws dynamodb batch-write-item --request-items "{\"$T\":[$(for i in $(seq 1 25); do echo -n "{\"PutRequest\":{\"Item\":{\"pk\":{\"S\":\"item-$i\"},\"data\":{\"S\":\"value-$i\"}}}}"; [ $i -lt 25 ] && echo -n ","; done)]}
13+
14+
The script handles this step automatically. See `dynamodb-batch-ops.sh` for the exact CLI commands.
15+
16+
## Step 3: Batch get (5 items)"; aws dynamodb batch-get-item --request-items "{\"$T\":{\"Keys\":[{\"pk\":{\"S\":\"item-1\"}},{\"pk\":{\"S\":\"item-5\"}},{\"pk\":{\"S\":\"item-10\"}},{\"pk\":{\"S\":\"item-15\"}},{\"pk\":{\"S\":\"item-20\"}}]}}" --query "Responses.\"$T\"[].{pk:pk.S,data:data.S}
17+
18+
The script handles this step automatically. See `dynamodb-batch-ops.sh` for the exact CLI commands.
19+
20+
## Step 4: Scan count"; aws dynamodb scan --table-name "$T
21+
22+
The script handles this step automatically. See `dynamodb-batch-ops.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+
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Lambda List Functions
2+
3+
A read-only script that queries Lambda resources and displays information.
4+
5+
## Running
6+
7+
```bash
8+
bash lambda-list-functions.sh
9+
```
10+
11+
## What it does
12+
13+
1. Listing functions
14+
2. Function count by runtime
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 lambda reference](https://docs.aws.amazon.com/cli/latest/reference/lambda/index.html)
27+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Lambda List Functions
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 functions
9+
10+
The script handles this step automatically. See `lambda-list-functions.sh` for the exact CLI commands.
11+
12+
## Step 2: Function count by runtime
13+
14+
The script handles this step automatically. See `lambda-list-functions.sh` for the exact CLI commands.
15+
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Ec2 Security Group Rules
2+
3+
A read-only script that queries Ec2 resources and displays information.
4+
5+
## Running
6+
7+
```bash
8+
bash ec2-security-group-rules.sh
9+
```
10+
11+
## What it does
12+
13+
1. Listing security groups
14+
2. Finding groups with open SSH
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 ec2 reference](https://docs.aws.amazon.com/cli/latest/reference/ec2/index.html)
27+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Ec2 Security Group Rules
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 security groups
9+
10+
The script handles this step automatically. See `ec2-security-group-rules.sh` for the exact CLI commands.
11+
12+
## Step 2: Finding groups with open SSH
13+
14+
The script handles this step automatically. See `ec2-security-group-rules.sh` for the exact CLI commands.
15+
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Lambda Event Invoke Config
2+
3+
A read-only script that queries Lambda resources and displays information.
4+
5+
## Running
6+
7+
```bash
8+
bash lambda-event-invoke-config.sh
9+
```
10+
11+
## What it does
12+
13+
1. Listing functions with event invoke configs
14+
15+
## Resources created
16+
17+
None — this script is read-only.
18+
19+
## Cost
20+
21+
No cost. This script only reads existing resources.
22+
23+
## Related docs
24+
25+
- [AWS CLI lambda reference](https://docs.aws.amazon.com/cli/latest/reference/lambda/index.html)
26+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Lambda Event Invoke Config
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 functions with event invoke configs
9+
10+
The script handles this step automatically. See `lambda-event-invoke-config.sh` for the exact CLI commands.
11+
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Ec2 Cost Optimization
2+
3+
A read-only script that queries Ec2 resources and displays information.
4+
5+
## Running
6+
7+
```bash
8+
bash ec2-cost-optimization.sh
9+
```
10+
11+
## What it does
12+
13+
1. Finding stopped instances (still incurring EBS charges)
14+
2. Finding unattached EBS volumes
15+
3. Finding unattached Elastic IPs
16+
4. Finding old snapshots (>90 days)
17+
18+
## Resources created
19+
20+
None — this script is read-only.
21+
22+
## Cost
23+
24+
No cost. This script only reads existing resources.
25+
26+
## Related docs
27+
28+
- [AWS CLI ec2 reference](https://docs.aws.amazon.com/cli/latest/reference/ec2/index.html)
29+
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Ec2 Cost Optimization
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: Finding stopped instances (still incurring EBS charges)
9+
10+
The script handles this step automatically. See `ec2-cost-optimization.sh` for the exact CLI commands.
11+
12+
## Step 2: Finding unattached EBS volumes
13+
14+
The script handles this step automatically. See `ec2-cost-optimization.sh` for the exact CLI commands.
15+
16+
## Step 3: Finding unattached Elastic IPs
17+
18+
The script handles this step automatically. See `ec2-cost-optimization.sh` for the exact CLI commands.
19+
20+
## Step 4: Finding old snapshots (>90 days)
21+
22+
The script handles this step automatically. See `ec2-cost-optimization.sh` for the exact CLI commands.
23+

0 commit comments

Comments
 (0)