/destroy-hc-aws
Destroy a HyperShift HostedCluster and all associated AWS infrastructure (VPC, IAM, Route53, etc.).
$ npx -y skills add openshift/hypershift --skill destroy-hc-aws --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/destroy-hc-aws
Context preview
The summary Claude sees to decide when to auto-load this skill.
Destroy a HyperShift HostedCluster and all associated AWS infrastructure (VPC, IAM, Route53, etc.).
SKILL.md
destroy-hc-aws.SKILL.mdname: Destroy HC AWS
description: "Destroy a HyperShift HostedCluster and all associated AWS infrastructure (VPC, IAM, Route53, etc.)."
Destroy HostedCluster
This skill destroys a HyperShift HostedCluster and all associated AWS infrastructure.
When to Use This Skill
Use this skill when:
- You need to clean up a test HostedCluster
- You want to destroy a HostedCluster and its AWS resources (VPC, subnets, NAT gateways, IAM roles, etc.)
- You need to remove orphaned HostedClusters from previous test runs
Prerequisites
Source the environment file before using this skill:
source dev/claude-env.sh
Additional requirements:
- AWS credentials loaded (source `$AWS_CREDS_SOURCE`)
- KUBECONFIG pointing to management cluster (`$MGMT_KUBECONFIG`)
- hypershift binary built (`./bin/hypershift`)
Environment Configuration
Environment variables from `dev/claude-env.sh`:
| Variable | Description | |----------|-------------| | `AWS_CREDENTIALS` | Path to AWS credentials file | | `AWS_CREDS_SOURCE` | Script to source AWS env vars | | `AWS_REGION` | AWS region | | `MGMT_KUBECONFIG` | Path to management cluster kubeconfig |
Command
source $AWS_CREDS_SOURCE && \
KUBECONFIG=$MGMT_KUBECONFIG \
./bin/hypershift destroy cluster aws \
--name <CLUSTER_NAME> \
--namespace <NAMESPACE> \
--aws-creds $AWS_CREDENTIALS \
--region $AWS_REGION
Parameters
| Parameter | Description | Default | |-----------|-------------|---------| | `--name` | Name of the HostedCluster to destroy | Required | | `--namespace` | Namespace where the HostedCluster exists | `clusters` | | `--aws-creds` | Path to AWS credentials file | `$AWS_CREDENTIALS` | | `--region` | AWS region | `$AWS_REGION` |
What Gets Destroyed
The command destroys:
- HostedCluster and NodePool resources
- HostedControlPlane namespace and all resources
- AWS VPC and subnets
- NAT gateways and internet gateways
- Route tables
- Security groups
- DHCP options
- Private hosted zones (Route53)
- OIDC provider
- IAM roles and instance profiles
- VPC endpoints
- Elastic IPs
Quick Cleanup for Orphaned HCs
If a HostedCluster is stuck deleting, you can force remove it:
# Remove cleanup annotation to skip cloud resource cleanup
KUBECONFIG=$MGMT_KUBECONFIG kubectl annotate hostedcluster <NAME> -n <NAMESPACE> \
hypershift.openshift.io/cleanup-cloud-resources-
Example Usage
# List existing HostedClusters
KUBECONFIG=$MGMT_KUBECONFIG kubectl get hostedclusters -A
# Destroy a specific HostedCluster
source $AWS_CREDS_SOURCE && \
KUBECONFIG=$MGMT_KUBECONFIG \
./bin/hypershift destroy cluster aws \
--name my-test-cluster \
--namespace clusters \
--aws-creds $AWS_CREDENTIALS \
--region $AWS_REGION
Troubleshooting
NAT Gateway Still Deleting
NAT gateways take time to delete. The command will retry automatically.
VPC Has Dependencies
The command will retry until all dependencies (subnets, gateways, etc.) are deleted.
HostedCluster Stuck in Deleting
1. Check if there are stuck finalizers 2. Remove the cleanup-cloud-resources annotation if you want to skip AWS cleanup 3. Manually delete AWS resources if needed
Read more
name: Destroy HC AWS description: "Destroy a HyperShift HostedCluster and all associated AWS infrastructure (VPC, IAM, Route53, etc.)."
Destroy HostedCluster
This skill destroys a HyperShift HostedCluster and all associated AWS infrastructure.
When to Use This Skill
Use this skill when:
- You need to clean up a test HostedCluster
- You want to destroy a HostedCluster and its AWS resources (VPC, subnets, NAT gateways, IAM roles, etc.)
- You need to remove orphaned HostedClusters from previous test runs
Prerequisites
Source the environment file before using this skill:
source dev/claude-env.sh
Additional requirements:
- AWS credentials loaded (source `$AWS_CREDS_SOURCE`)
- KUBECONFIG pointing to management cluster (`$MGMT_KUBECONFIG`)
- hypershift binary built (`./bin/hypershift`)
Environment Configuration
Environment variables from `dev/claude-env.sh`:
| Variable | Description | |----------|-------------| | `AWS_CREDENTIALS` | Path to AWS credentials file | | `AWS_CREDS_SOURCE` | Script to source AWS env vars | | `AWS_REGION` | AWS region | | `MGMT_KUBECONFIG` | Path to management cluster kubeconfig |
Command
source $AWS_CREDS_SOURCE && \ KUBECONFIG=$MGMT_KUBECONFIG \ ./bin/hypershift destroy cluster aws \ --name <CLUSTER_NAME> \ --namespace <NAMESPACE> \ --aws-creds $AWS_CREDENTIALS \ --region $AWS_REGION
Parameters
| Parameter | Description | Default | |-----------|-------------|---------| | `--name` | Name of the HostedCluster to destroy | Required | | `--namespace` | Namespace where the HostedCluster exists | `clusters` | | `--aws-creds` | Path to AWS credentials file | `$AWS_CREDENTIALS` | | `--region` | AWS region | `$AWS_REGION` |
What Gets Destroyed
The command destroys:
- HostedCluster and NodePool resources
- HostedControlPlane namespace and all resources
- AWS VPC and subnets
- NAT gateways and internet gateways
- Route tables
- Security groups
- DHCP options
- Private hosted zones (Route53)
- OIDC provider
- IAM roles and instance profiles
- VPC endpoints
- Elastic IPs
Quick Cleanup for Orphaned HCs
If a HostedCluster is stuck deleting, you can force remove it:
# Remove cleanup annotation to skip cloud resource cleanup KUBECONFIG=$MGMT_KUBECONFIG kubectl annotate hostedcluster <NAME> -n <NAMESPACE> \ hypershift.openshift.io/cleanup-cloud-resources-
Example Usage
# List existing HostedClusters KUBECONFIG=$MGMT_KUBECONFIG kubectl get hostedclusters -A # Destroy a specific HostedCluster source $AWS_CREDS_SOURCE && \ KUBECONFIG=$MGMT_KUBECONFIG \ ./bin/hypershift destroy cluster aws \ --name my-test-cluster \ --namespace clusters \ --aws-creds $AWS_CREDENTIALS \ --region $AWS_REGION
Troubleshooting
NAT Gateway Still Deleting
NAT gateways take time to delete. The command will retry automatically.
VPC Has Dependencies
The command will retry until all dependencies (subnets, gateways, etc.) are deleted.
HostedCluster Stuck in Deleting
1. Check if there are stuck finalizers 2. Remove the cleanup-cloud-resources annotation if you want to skip AWS cleanup 3. Manually delete AWS resources if needed
HyperShift is a middleware for hosting OpenShift control planes at scale that solves for cost and time to provision, as well as portability cross cloud with strong separation of concerns between management and workloads.
Repo: openshift/hypershift
Other skills on hypershift.
- /create-cpo-override
Interactively create CPO image overrides — resolves images, verifies fixes, edits overrides.yaml, and prepares a PR
Open skill - /debug-cluster
Provides systematic debugging approaches for HyperShift hosted-cluster issues. Auto-applies when debugging cluster problems, investigating stuck deletions, or troubleshooting control plane issues.
Open skill - /build-cpo-image
Build and push control-plane-operator container image. Auto-applies when testing CPO changes that require deploying to a live cluster.
Open skill - /build-ho-image
Build and push hypershift-operator container image. Auto-applies when testing HO changes that require deploying to a live cluster.
Open skill - /create-hc-aws
Create a HyperShift HostedCluster on AWS for development and testing, with optional custom CPO/HO images.
Open skill - /e2e-run-aws
Provides the ability to run and iterate on HyperShift e2e tests. Auto-applies when implementing features that require e2e validation, fixing e2e test failures, or working on tasks that need live cluster testing.
Open skill

