Clean Workshop Resources
Clean up AWS resources created by the AgentCore onboarding workshop.
Usage
/clean-workshop — Clean all workshop resources (09, 08, 07, 06, 05, 03, 02)
/clean-workshop 02 — Clean only step 02 (runtime)
/clean-workshop 02 03 — Clean steps 02 and 03
/clean-workshop 05 06 07 — Clean steps 05, 06, and 07
/clean-workshop 08 09 — Clean steps 08 and 09
Arguments
$ARGUMENTS contains space-separated step numbers to clean (e.g., 02 03 07).
If empty, clean ALL steps that have resources.
Steps with Cleanable Resources
Only these steps create AWS resources that need cleanup:
| Step |
Directory |
Resources |
Config File |
| 02 |
02_runtime/ |
Agent runtime, ECR repository, config files |
.bedrock_agentcore.yaml |
| 03 |
03_memory/ |
Memory instances (prefix: cost_estimator_memory) |
None |
| 05 |
05_evaluation/ |
Custom evaluator (name: cost_estimator_tool_usage) |
None |
| 06 |
06_identity/ |
OAuth2 provider, Cognito user pool/client/domain, runtime |
inbound_authorizer.json |
| 07 |
07_gateway/ |
Gateway targets, gateway, config files |
outbound_gateway.json |
| 08 |
08_policy/ |
Policy engine, policies, Cognito app clients |
policy_config.json |
| 09 |
09_browser_use/ |
Browser sessions (ephemeral, auto-expire) |
None |
Dependency Order (CRITICAL)
Resources MUST be cleaned in reverse dependency order to avoid errors:
- 09_browser_use first (independent, ephemeral sessions)
- 08_policy second (depends on 07_gateway)
- 07_gateway (depends on 06_identity)
- 06_identity (depends on 02_runtime)
- 05_evaluation (independent)
- 03_memory (independent)
- 02_runtime last (other steps depend on it)
Execution
For each step to clean, run:
cd <project_root>/<step_directory> && uv run python clean_resources.py
Before cleaning each step:
- Check if the config file exists (indicates resources were created)
- If no config file, skip that step with a message
- Run
clean_resources.py from within the step directory (scripts use relative paths)
- Report success or failure for each step
Error handling:
- If a step fails, log the error and continue with remaining steps
- Report a summary at the end showing which steps succeeded/failed
- Common errors: ResourceNotFoundException (already deleted), config file missing (never created)
Implementation
- Parse
$ARGUMENTS to determine which steps to clean. If empty, use all: 09 08 07 06 05 03 02
- Sort the requested steps in correct cleanup order: 09, 08, 07, 06, 05, 03, 02
- Create a task list tracking each step
- For each step (in order):
a. Check if the step directory and config file exist
b. If resources exist, run
clean_resources.py from that directory
c. Mark task as completed
- Print a final summary
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: clean-workshop3description: Clean up AWS resources created by the AgentCore workshop. Use when someone wants to tear down, clean up, or remove workshop resources. Use when this capability is needed.4---56# Clean Workshop Resources78Clean up AWS resources created by the AgentCore onboarding workshop.910## Usage1112- `/clean-workshop` — Clean all workshop resources (09, 08, 07, 06, 05, 03, 02)13- `/clean-workshop 02` — Clean only step 02 (runtime)14- `/clean-workshop 02 03` — Clean steps 02 and 0315- `/clean-workshop 05 06 07` — Clean steps 05, 06, and 0716- `/clean-workshop 08 09` — Clean steps 08 and 091718## Arguments1920`$ARGUMENTS` contains space-separated step numbers to clean (e.g., `02 03 07`).21If empty, clean ALL steps that have resources.2223## Steps with Cleanable Resources2425Only these steps create AWS resources that need cleanup:2627| Step | Directory | Resources | Config File |28|------|-----------|-----------|-------------|29| 02 | `02_runtime/` | Agent runtime, ECR repository, config files | `.bedrock_agentcore.yaml` |30| 03 | `03_memory/` | Memory instances (prefix: `cost_estimator_memory`) | None |31| 05 | `05_evaluation/` | Custom evaluator (name: `cost_estimator_tool_usage`) | None |32| 06 | `06_identity/` | OAuth2 provider, Cognito user pool/client/domain, runtime | `inbound_authorizer.json` |33| 07 | `07_gateway/` | Gateway targets, gateway, config files | `outbound_gateway.json` |34| 08 | `08_policy/` | Policy engine, policies, Cognito app clients | `policy_config.json` |35| 09 | `09_browser_use/` | Browser sessions (ephemeral, auto-expire) | None |3637## Dependency Order (CRITICAL)3839Resources MUST be cleaned in reverse dependency order to avoid errors:401. **09_browser_use** first (independent, ephemeral sessions)412. **08_policy** second (depends on 07_gateway)423. **07_gateway** (depends on 06_identity)434. **06_identity** (depends on 02_runtime)445. **05_evaluation** (independent)456. **03_memory** (independent)467. **02_runtime** last (other steps depend on it)4748## Execution4950For each step to clean, run:51```52cd <project_root>/<step_directory> && uv run python clean_resources.py53```5455### Before cleaning each step:561. Check if the config file exists (indicates resources were created)572. If no config file, skip that step with a message583. Run `clean_resources.py` from within the step directory (scripts use relative paths)594. Report success or failure for each step6061### Error handling:62- If a step fails, log the error and continue with remaining steps63- Report a summary at the end showing which steps succeeded/failed64- Common errors: ResourceNotFoundException (already deleted), config file missing (never created)6566## Implementation67681. Parse `$ARGUMENTS` to determine which steps to clean. If empty, use all: `09 08 07 06 05 03 02`692. Sort the requested steps in correct cleanup order: 09, 08, 07, 06, 05, 03, 02703. Create a task list tracking each step714. For each step (in order):72 a. Check if the step directory and config file exist73 b. If resources exist, run `clean_resources.py` from that directory74 c. Mark task as completed755. Print a final summary7677---78> Converted and distributed by [TomeVault](https://tomevault.io/claim/aws-samples) — claim your Tome and manage your conversions.79<!-- tomevault:4.0:skill_md:2026-04-11 -->