Skip to content

Instantly share code, notes, and snippets.

@niranjan94
niranjan94 / uninstall-ecs-anywhere.sh
Last active April 6, 2026 07:59 — forked from nathanpeck/uninstall-ecs-anywhere.sh
Uninstall ECS Anywhere from a host, for reinstall, or registration with a different account/region/cluster
apt remove -y amazon-ssm-agent amazon-ecs-init
rm -rfv /var/lib/amazon/ssm/Vault/Store/RegistrationKey
rm -rfv /var/lib/ecs/ecs.config
rm -rfv /etc/ecs/ecs.config
rm -rfv /var/lib/ecs/data/*
#!/usr/bin/env python
import json
import os
from argparse import ArgumentParser
from contextlib import suppress
from shutil import make_archive
import boto3
from botocore.exceptions import ClientError

Keybase proof

I hereby claim:

  • I am niranjan94 on github.
  • I am niranjan94 (https://keybase.io/niranjan94) on keybase.
  • I have a public key ASAc4bRJIWZoQDz81QuWLdeBqmhOYHKUagtHQA4S_EoGnwo

To claim this, I am signing this object: