/cloud-skills:orphaned-cloud-resource-cleanupfrom cloud-skills
Finds and safely removes orphaned cloud resources that accumulate silent cost: unattached EBS volumes/managed disks, unassociated Elastic IPs/Azure Public IPs, orphaned load balancers/target groups, and stale manual snapshots. Includes a non-use confirmation procedure before any deletion. Covers AWS and Azure (with GCP equivalents).
Ships in cloud-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Every cloud account accumulates a background hum of resources that outlived the thing they were attached to: an EBS volume/managed disk left behind after its instance was terminated, an Elastic IP/Public IP reserved for a test that was never released, a load balancer or target group pointing at a service that was decommissioned months ago, a manual snapshot taken "just in case" before a change that was never cleaned up afterward. None of these show up as a dramatic cost spike — each is individually cheap — but collectively, across dozens of accounts and years of accumulation, they become a steady, invisible tax. This skill covers finding these specific classes of orphaned resource and removing them safely, with the non-negotiable discipline that "looks unattached" and "is confirmed unused" are not the same thing — a resource detached from its original parent can still be an intentional backup, a disaster-recovery artifact, or something a team meant to reattach next sprint.
ec2, elb/elbv2) or Trusted Advisor, Azure CLI (az disk,
az network public-ip, az network lb) or Azure Advisor, gcloud compute for the GCP equivalents (persistent disks, static external IP
addresses, forwarding rules/load balancers).owner, environment,
decommission-date) to check before deleting anything — per
cloud-cost-finops-optimization —
since tag absence is itself a reason for extra caution, not a green
light to delete faster.Enumerate candidates by state, not by age alone. Age is a weak signal on its own; attachment/association state is the primary filter.
aws ec2 describe-volumes \
--filters "Name=status,Values=available" \
--query "Volumes[].{ID:VolumeId,Size:Size,Created:CreateTime,Tags:Tags}"
(available = not attached to any instance; in-use volumes are
excluded automatically by the filter.)az disk list --query "[?diskState=='Unattached'].{Name:name, Size:diskSizeGb, TimeCreated:timeCreated, Tags:tags}"
aws ec2 describe-addresses \
--query "Addresses[?AssociationId==null].{IP:PublicIp,AllocationId:AllocationId,Tags:Tags}"
az network public-ip list --query "[?ipConfiguration==null].{Name:name, IP:ipAddress}"
aws elbv2 describe-target-groups --query "TargetGroups[].TargetGroupArn" \
| xargs -I{} aws elbv2 describe-target-health --target-group-arn {}
# empty TargetHealthDescriptions for a sustained period = candidate
az network lb list --query "[?backendAddressPools[0].backendIpConfigurations==null].name"
aws ec2 describe-snapshots --owner-ids self \
--query "Snapshots[?StartTime<='2026-04-01'].{ID:SnapshotId,VolumeId:VolumeId,Description:Description}"
Cross-check every candidate against tags and DR/backup policy
before treating it as a true orphan. A resource with an owner tag
still active, or one covered by
disaster-recovery-and-backup-strategy's
backup vault/retention policy (e.g. a snapshot inside an AWS Backup
Vault Lock retention window, or a disk explicitly retained as a
pilot-light DR asset), is not a cleanup candidate regardless of
attachment state. Filter these out of the candidate list before
proceeding, don't just note them for later.
Confirm true non-use with a second signal beyond attachment state, not attachment state alone:
Notify the owner (or last-known owner from tags/audit logs) with a grace period before deleting, rather than deleting immediately on finding a candidate:
# Example: tag as pending-deletion with a future date instead of deleting immediately
aws ec2 create-tags --resources vol-0123456789abcdef0 \
--tags Key=pending-deletion,Value=2026-08-11 Key=flagged-by,Value=cleanup-sweep-2026-07
Equivalent on Azure: az tag update or a resource-group-level
"quarantine" tag. Send the notification (email, Slack, a ticket) to
the tagged/last-known owner, or to a general platform-team channel if
no owner can be identified, with the deletion date and an easy way to
object.
Delete only after the grace period elapses with no objection, and only the specific confirmed-orphaned resource — never as a bulk "delete everything matching the filter" pass without the per-resource confirmation from steps 2-3:
# AWS: release an unassociated Elastic IP
aws ec2 release-address --allocation-id <ALLOCATION_ID>
# AWS: delete a confirmed-unattached EBS volume
aws ec2 delete-volume --volume-id <VOLUME_ID>
# Azure: release/delete an unassociated Public IP
az network public-ip delete --name <PUBLIC_IP_NAME> --resource-group <RESOURCE_GROUP>
# Azure: delete a confirmed-unattached managed disk
az disk delete --name <DISK_NAME> --resource-group <RESOURCE_GROUP> --yes
Warning: These are destructive, typically irreversible actions (a deleted EBS volume/managed disk cannot be recovered unless a snapshot exists independently; a released Elastic IP/Public IP may be reassigned to another customer entirely and is not guaranteed recoverable). Never run a bulk delete loop directly off the enumeration query in step 1 — always pass every candidate through steps 2-4 first, and prefer taking a final safety snapshot of a volume/disk immediately before deleting it if there is any residual uncertainty.
For load balancers/target groups with zero targets, confirm the downstream DNS/service discovery record no longer points at it before deletion — an idle-looking load balancer can still be the intended target of a DNS record for a service currently scaled to zero rather than decommissioned (e.g. a batch/seasonal workload).
Automate the enumeration + notify steps as a recurring scheduled job (weekly/monthly), not a one-time manual sweep — orphaned resources accumulate continuously as workloads are terminated, so a one-time cleanup regresses within a quarter without a recurring check. Keep the deletion step itself either manual (a human clicks "confirm") or gated behind the same grace-period/notification logic even when automated.
Track and report savings realized, feeding it back into the FinOps showback view — a completed cleanup sweep is good input for cloud-cost-finops-optimization's reporting, and demonstrates the recurring check's value to stakeholders who might otherwise question the process overhead.
Symptom: A cleanup script deletes an unattached EBS volume that turns out to be a manually detached backup source a team relied on, and the data is unrecoverable. Fix: Never auto-delete storage resources flagged as idle without a grace period, notification, and human confirmation — this is destructive and often irreversible. Always run candidates through the tag/audit-log/DR-policy cross-check (steps 2-3) and the notify-then- wait grace period (step 4) before any deletion, especially for anything that held data.
Symptom: A released Elastic IP/Public IP that "looked unused" was actually allowlisted by a customer's firewall or referenced in a partner integration's static-IP allowlist, and releasing it breaks that integration when the IP gets reassigned elsewhere. Fix: Cloud-side association state doesn't capture external dependencies. Before releasing any IP, check firewall rules, DNS records, and any documented partner/customer allowlist referencing it — treat a static IP as higher-risk to release than a volume, since the consequence of a mistake (address reassigned to an unrelated account) is harder to reverse than restoring from a snapshot.
Symptom: A load balancer with zero currently-registered targets gets deleted, and it turns out to be the intended target of a scheduled/seasonal batch workload that scales up only once a quarter. Fix: Zero targets right now isn't the same as permanently unused. Check the load balancer's target-group history and any scheduled-scaling configuration over a longer window (at least one full scaling cycle) before concluding it's orphaned, and confirm with the owning team from its tags/naming convention.
Symptom: A recurring cleanup sweep starts flagging (and someone eventually deletes) a cross-region backup snapshot or a pilot-light DR replica because it looks idle by the same criteria used for genuine orphans. Fix: DR-pattern resources are supposed to look idle under normal operating conditions — that's not the same as orphaned. Explicitly exclude resources tagged or known to be part of an active disaster-recovery-and-backup-strategy plan from the candidate list at step 2, and require sign-off from whoever owns the DR plan before touching anything that might be one.
Symptom: The cleanup process finds hundreds of untagged candidates and, to move fast, someone deletes everything older than a threshold in one bulk pass. Fix: Volume of candidates is not a reason to skip per-resource confirmation — it's a reason to batch the notification step (a single digest listing all candidates with their grace-period deadline) while still deleting only after the individual grace period elapses unobjected, never as one undifferentiated bulk delete command.
Scenario: A monthly scheduled cleanup sweep runs against a
checkout-nonprod AWS account and finds 14 unattached EBS volumes, 3
unassociated Elastic IPs, and 1 load balancer with no registered targets.
describe-volumes --filters Name=status,Values=available query returns 14 volumes; cross-checked
against describe-addresses and describe-target-health.dr-role=pilot-light-replica-source tag matching an entry in the
account's DR runbook — excluded immediately, not just noted.CreateTime/detachment timestamp older than 60 days with no matching
CloudTrail DetachVolume event tied to an active migration; 3 were
detached only 4 days ago during an in-progress instance-type change
still tracked in an open ticket — those 3 are excluded from this
sweep and re-checked next month.pending-deletion=2026-08-11, and a digest listing all 9 (volume ID,
size, last-known owner tag or "untagged — flagging platform-team
channel") is posted to the team channel with a two-week grace period.pending-deletion tag is removed.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
cloud-cost, resource-cleanup, orphaned-resources, aws, azure, cost-optimization
npx claudepluginhub selvarajmurugesan90/ops-engineering-skills --plugin cloud-skills14 skills in this plugin
/aws-landing-zone-setupGuides designing and implementing a multi-account AWS landing zone using AWS Organizations, Control Tower, and Account Factory — including the account/OU hierarchy, Service Control Policies, centralized logging, and baseline guardrails. Use when a user asks to "set up a new AWS account structure", "design an AWS landing zone", "implement AWS Control Tower", "create OUs and SCPs", "bootstrap a multi-account AWS environment", or "onboard a new AWS account into our organization".
/azure-landing-zone-setupGuides designing and implementing an Azure landing zone using Management Groups, subscription democratization, Azure Policy, and the Cloud Adoption Framework (CAF) Landing Zone Accelerator pattern. Use when a user asks to "design an Azure landing zone", "set up Management Groups and subscriptions", "implement Azure Policy guardrails", "onboard a new Azure subscription", "structure our Azure tenant", or "migrate to the CAF enterprise-scale landing zone".
/cloud-access-request-and-iam-lifecycle-managementHandles the everyday operational request to grant, time-box, and later revoke a scoped IAM permission for a contractor, new hire, or a temporary need (e.g. "give the new contractor read-only S3 access for 30 days," "grant break-fix access to prod for this incident," "revoke Priya's access, she left the team," "why does this access request keep getting rejected") — including expiry enforcement and the audit trail a security review will ask for. Use for a single access grant/revoke transaction, not for designing the underlying IAM policy/role structure (see cloud-iam-hardening for that).
Other plugins' skills for the same job