teardown
Safely removes all AWS resources created by this plugin. Permanently deletes cloud resources.
What this skill does
# Teardown — Remove AWS Resources
You are removing all AWS resources that were created during the deployment. This is irreversible.
## Prerequisites
- AWS resources were previously deployed
- AWS CLI is configured and working
## What To Do
### Phase 1: Plan
Show the user exactly what will be deleted:
1. **List all deployed stacks:**
```bash
cd infrastructure && npx cdk list
```
2. **For each stack, explain what gets deleted:**
- "Lambda functions — your API will stop working"
- "API Gateway — API endpoints will return errors"
- "DynamoDB table — your data will be..."
- If RemovalPolicy.RETAIN: "...preserved (you can delete it manually later)"
- If RemovalPolicy.DESTROY: "...permanently deleted"
- "S3 bucket — your frontend files will be deleted"
- "CloudFront distribution — your site URL will stop working"
- "Cognito User Pool — all user accounts will be..."
- If RemovalPolicy.RETAIN: "...preserved"
- If RemovalPolicy.DESTROY: "...permanently deleted"
3. **Highlight data implications:**
- "DynamoDB tables with RETAIN policy will survive and need manual cleanup"
- "All other resources will be permanently deleted"
- "This cannot be undone"
### Phase 2: Confirm
**Get explicit confirmation:**
"This will permanently delete the following AWS resources:"
- [list each resource]
- "Any data in DynamoDB tables with DESTROY policy will be lost"
- "Your site will go offline immediately"
"Are you absolutely sure you want to proceed? Type 'yes' to confirm."
Wait for explicit confirmation. Do NOT proceed without it.
### Phase 3: Execute
1. **Empty S3 buckets first** (CDK can't delete non-empty buckets):
```bash
aws s3 rm s3://[bucket-name] --recursive
```
Explain: "Emptying the S3 bucket before deleting the stack"
2. **Destroy all stacks:**
```bash
cd infrastructure && npx cdk destroy --all --force
```
Stream progress and explain what's being removed
3. **Handle errors:**
- If destruction fails, explain the error and suggest fixes
- Common issues: non-empty S3 buckets, resources in use, permission errors
- Some resources may need manual deletion
### Phase 4: Post-Teardown
1. **Verify deletion:**
```bash
cd infrastructure && npx cdk list
```
Should return empty or error (no stacks)
2. **Check for retained resources:**
- DynamoDB tables with RETAIN policy
- CloudWatch log groups (CDK often doesn't delete these)
- CDK bootstrap resources (usually fine to keep)
3. **Guide manual cleanup if needed:**
- "These resources were retained and may need manual cleanup:"
- Provide AWS Console URLs or CLI commands for each
- Explain how to delete them if the user wants to
4. **Clean up local files:**
- Ask if user wants to remove `.migration/outputs.json`
- Update `.migration/plan.md` to reflect teardown
5. **Final message:**
- "All resources have been removed. Your AWS account should not incur any further charges from this deployment."
- "The CDK bootstrap resources are still in your account — they cost virtually nothing and can be reused for future deployments."
- "Your code is still here locally — you can redeploy anytime"
## Important Notes
### Safety
- ALWAYS confirm before destroying
- List every resource that will be deleted
- Highlight data loss implications
- Check for retained resources after deletion
### Common Issues
- S3 buckets must be emptied before the stack can be deleted
- CloudFront distributions take 5-15 minutes to delete
- If a stack is in ROLLBACK_COMPLETE state, it needs `aws cloudformation delete-stack`
- Log groups may remain — they cost nothing but can be cleaned up
### What's NOT Deleted
- CDK bootstrap resources (CDKToolkit stack) — keep these for future deployments
- CloudWatch log groups — minimal cost, can be manually deleted
- Any resources with RemovalPolicy.RETAIN
Related in Cloud & DevOps
appbuilder-action-scaffolder
IncludedCreate, implement, deploy, and debug Adobe Runtime actions with consistent layout, validation, and error handling. Use this skill whenever the user needs to add actions to an App Builder project, understand action structure (params, response format, web/raw actions), configure actions in the manifest, use App Builder SDKs (State, Files, Events, database), deploy and invoke actions via CLI, debug action issues, or implement patterns such as webhook receivers, custom event providers, journaling consumers, large payload redirects, action sequence pipelines, and Asset Compute workers. Also trigger when users mention serverless functions in Adobe context, action logging, IMS authentication for actions, or cron-style scheduled actions.
orchestrating-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. Use this skill when the user needs a multi-step Data Cloud pipeline, cross-phase troubleshooting, or data space and data kit management. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase sf data360 workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching phase-specific skill), the task is STDM/session tracing/parquet telemetry (use observing-agentforce), standard CRM SOQL (use querying-soql), or Apex implementation (use generating-apex).
github-project-automation
IncludedAutomate GitHub repository setup with CI/CD workflows, issue templates, Dependabot, and CodeQL security scanning. Includes 12 production-tested workflows and prevents 18 errors: YAML syntax, action pinning, and configuration. Use when: setting up GitHub Actions CI/CD, creating issue/PR templates, enabling Dependabot or CodeQL scanning, deploying to Cloudflare Workers, implementing matrix testing, or troubleshooting YAML indentation, action version pinning, secrets syntax, runner versions, or CodeQL configuration. Keywords: github actions, github workflow, ci/cd, issue templates, pull request templates, dependabot, codeql, security scanning, yaml syntax, github automation, repository setup, workflow templates, github actions matrix, secrets management, branch protection, codeowners, github projects, continuous integration, continuous deployment, workflow syntax error, action version pinning, runner version, github context, yaml indentation error
sf-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase `sf data360` workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching sf-datacloud-* skill), the task is STDM/session tracing/parquet telemetry (use sf-ai-agentforce-observability), standard CRM SOQL (use sf-soql), or Apex implementation (use sf-apex).
fabric-cli
IncludedUse this skill for Fabric.so CLI workflows with the `fabric` terminal command: diagnose/install/login, search or browse a Fabric library, save notes/links/files, create folders, ask the Fabric AI assistant, manage tasks/workspaces, generate shell completion, check subscription usage, produce JSON output, and use Fabric as persistent agent memory. Do not use for Microsoft Fabric/Azure/Power BI `fab`, Daniel Miessler's Fabric framework, Python Fabric SSH, Fabric.js, or textile/fashion fabric.
lark
IncludedLark/Feishu CLI skills: lark-cli operations for docs, markdown, sheets, base, calendar, im, mail, task, okr, drive, wiki, slides, whiteboard, apps, approval, attendance, contact, vc, minutes, event. Use when the user needs to operate Lark/Feishu resources via lark-cli, send messages, manage documents, spreadsheets, calendars, tasks, OKRs, deploy web pages, or any Feishu/Lark workspace operations.