Skip to content

Commit cc1c3dd

Browse files
author
Rahul Arya
committed
Add PowerShell commands and fix key name consistency in README
1 parent 05cf8f1 commit cc1c3dd

1 file changed

Lines changed: 47 additions & 30 deletions

File tree

  • observability/aws-site-to-site-vpn-tunnel-investigation-devops-agent

observability/aws-site-to-site-vpn-tunnel-investigation-devops-agent/README.md

Lines changed: 47 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ What makes this demo unique: per-tunnel alarms ensure that even a single tunnel
5151
--query 'KeyMaterial' --output text > ~/.ssh/vpn-demo-key.pem
5252
chmod 400 ~/.ssh/vpn-demo-key.pem
5353
```
54-
**PowerShell (Windows):**
54+
PowerShell:
5555
```powershell
5656
mkdir -Force $HOME\.ssh
5757
aws ec2 create-key-pair --key-name vpn-demo-key `
5858
--query 'KeyMaterial' --output text | Set-Content -Path $HOME\.ssh\vpn-demo-key.pem -Encoding ASCII
5959
```
60-
- **bash** 4+ and **jq** (or PowerShell 5.1+ on Windows — use `deploy-all.ps1` instead)
60+
- **bash** 4+ and **jq** (or PowerShell 7+ on Windows — use `deploy-all.ps1` instead)
6161
- No existing DevOps Agent Space needed — the setup script creates one
6262

6363
## Quick Start
@@ -79,12 +79,22 @@ Run the setup script to create IAM roles, an Agent Space, and configure the webh
7979
bash scripts/setup-devops-agent.sh
8080
```
8181

82+
PowerShell:
83+
```powershell
84+
.\scripts\setup-devops-agent.ps1
85+
```
86+
8287
The script uses your configured AWS region (`aws configure get region`). To use a different region, pass `--region`:
8388

8489
```bash
8590
bash scripts/setup-devops-agent.sh --region us-west-2
8691
```
8792

93+
PowerShell:
94+
```powershell
95+
.\scripts\setup-devops-agent.ps1 -Region us-west-2
96+
```
97+
8898
The script automates steps 1–4 and pauses at step 5 for you to create the webhook:
8999

90100
1. Creates IAM roles (`DevOpsAgentRole-AgentSpace` and `DevOpsAgentRole-WebappAdmin`)
@@ -125,7 +135,7 @@ npx cdk deploy VpnDemoMcpServer-$REGION --require-approval never --no-cli-pager
125135
cd ../..
126136
```
127137

128-
**PowerShell (Windows):**
138+
PowerShell:
129139
```powershell
130140
$Region = aws configure get region
131141
@@ -162,7 +172,7 @@ aws apigateway get-api-key --api-key "$API_KEY_ID" --include-value \
162172
--query 'value' --output text --no-cli-pager
163173
```
164174

165-
**PowerShell (Windows):**
175+
PowerShell:
166176
```powershell
167177
$Region = aws configure get region
168178
@@ -195,7 +205,10 @@ aws apigateway get-api-key --api-key $ApiKeyId --include-value `
195205
8. Enter the API key details (in the order shown in the console):
196206
- **API Key Name**: `vpn-mcp-api-key` (a label — can be any name)
197207
- **API Key Header**: `x-api-key`
198-
- **API Key Value**: the API key from step 3b
208+
- **API Key Value**: run this command to get it:
209+
```bash
210+
aws apigateway get-api-key --api-key <ApiKeyId-from-step-3b> --include-value --query 'value' --output text --no-cli-pager
211+
```
199212
9. Click **Add** to register
200213
10. On the tool selection screen, select all three tools and click **Save**:
201214
- `get_service_dependencies`
@@ -207,12 +220,21 @@ aws apigateway get-api-key --api-key $ApiKeyId --include-value `
207220

208221
```bash
209222
bash deploy-all.sh \
210-
--key-file ~/.ssh/my-key.pem \
211-
--key-pair my-key-pair \
223+
--key-file ~/.ssh/vpn-demo-key.pem \
224+
--key-pair vpn-demo-key \
212225
--webhook-url 'https://your-webhook-url' \
213226
--webhook-secret 'your-webhook-secret'
214227
```
215228

229+
PowerShell:
230+
```powershell
231+
.\deploy-all.ps1 `
232+
-KeyFile ~\.ssh\vpn-demo-key.pem `
233+
-KeyPair vpn-demo-key `
234+
-WebhookUrl 'https://your-webhook-url' `
235+
-WebhookSecret 'your-webhook-secret'
236+
```
237+
216238
| Flag | Required | Description |
217239
|---|---|---|
218240
| `--key-file` | Yes | Path to the private key file for SSH access to the CGW |
@@ -274,13 +296,13 @@ The `inject-failure.sh` script injects realistic failures **on the customer gate
274296
275297
```bash
276298
# Inject a failure
277-
bash scripts/inject-failure.sh psk-mismatch --key-file ~/.ssh/my-key.pem
299+
bash scripts/inject-failure.sh psk-mismatch --key-file ~/.ssh/vpn-demo-key.pem
278300
279301
# Rollback
280-
bash scripts/inject-failure.sh psk-mismatch --key-file ~/.ssh/my-key.pem --rollback
302+
bash scripts/inject-failure.sh psk-mismatch --key-file ~/.ssh/vpn-demo-key.pem --rollback
281303
282304
# Check IPsec/BGP status
283-
bash scripts/inject-failure.sh status --key-file ~/.ssh/my-key.pem
305+
bash scripts/inject-failure.sh status --key-file ~/.ssh/vpn-demo-key.pem
284306
285307
# List all scenarios
286308
bash scripts/inject-failure.sh list
@@ -360,12 +382,7 @@ After completing the [Quick Start](#quick-start) deployment:
360382
### 1. Pick a scenario and inject
361383
362384
```bash
363-
bash scripts/inject-failure.sh psk-mismatch --key-file ~/.ssh/my-key.pem
364-
```
365-
366-
**PowerShell (Windows):**
367-
```powershell
368-
.\scripts\inject-failure.ps1 psk-mismatch -KeyFile $HOME\.ssh\vpn-demo-key.pem
385+
bash scripts/inject-failure.sh psk-mismatch --key-file ~/.ssh/vpn-demo-key.pem
369386
```
370387
371388
> **Note**: The script automatically checks tunnel health and CloudWatch alarm state before injecting. If anything is unhealthy (previous scenario not fully recovered), it warns you and asks to confirm.
@@ -379,23 +396,13 @@ Open the Operator App. Within 1–3 minutes, the agent receives the alarm webhoo
379396
### 3. Rollback
380397
381398
```bash
382-
bash scripts/inject-failure.sh psk-mismatch --key-file ~/.ssh/my-key.pem --rollback
383-
```
384-
385-
**PowerShell (Windows):**
386-
```powershell
387-
.\scripts\inject-failure.ps1 psk-mismatch -KeyFile $HOME\.ssh\vpn-demo-key.pem -Rollback
399+
bash scripts/inject-failure.sh psk-mismatch --key-file ~/.ssh/vpn-demo-key.pem --rollback
388400
```
389401
390402
### 4. Verify alarms returned to OK
391403
392404
```bash
393-
bash scripts/inject-failure.sh status --key-file ~/.ssh/my-key.pem
394-
```
395-
396-
**PowerShell (Windows):**
397-
```powershell
398-
.\scripts\inject-failure.ps1 status -KeyFile $HOME\.ssh\vpn-demo-key.pem
405+
bash scripts/inject-failure.sh status --key-file ~/.ssh/vpn-demo-key.pem
399406
```
400407
401408
Wait until all alarms show `OK` before injecting the next scenario. The throughput alarm may take up to 5 minutes to recover due to its 300-second evaluation period.
@@ -491,7 +498,12 @@ Deletes CloudWatch alarms, metric filter, and both CDK stacks (VPN + MCP server)
491498
492499
```bash
493500
bash scripts/cleanup.sh $(aws configure get region)
494-
# Windows: .\scripts\cleanup.ps1 -Region <region>
501+
```
502+
503+
PowerShell:
504+
```powershell
505+
$Region = aws configure get region
506+
.\scripts\cleanup.ps1 -Region $Region
495507
```
496508
497509
### Step 2: Delete remaining resources
@@ -585,7 +597,12 @@ aws ec2 delete-key-pair --key-name vpn-demo-key --region $Region
585597
586598
```bash
587599
bash scripts/verify-cleanup.sh $(aws configure get region)
588-
# Windows: .\scripts\verify-cleanup.ps1 -Region <region>
600+
```
601+
602+
PowerShell:
603+
```powershell
604+
$Region = aws configure get region
605+
.\scripts\verify-cleanup.ps1 -Region $Region
589606
```
590607
591608
## Contributing

0 commit comments

Comments
 (0)