Skip to content

Commit 494a855

Browse files
authored
Add cleanup script README (#98)
1 parent 5ebdba8 commit 494a855

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

cleanup/README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Cleanup
2+
3+
If you'd like to clean up scripts to clean up your environment from resources deployed by Elastio, then download and run the `aws-gc` binary developed by Elastio as shown below.
4+
5+
It discovers all resources with `elastio:resource` tag or with `elastio` in their name, shows the list of all of them, asks you to confirm by typing `yes`, and starts the deletion.
6+
7+
Run one of the following scripts in AWS Cloudshell or locally on your own machine. Choose the script depending on your OS.
8+
9+
## Linux
10+
11+
```bash
12+
curl -fLS "https://dl.cloudsmith.io/public/elastio/public/raw/versions/latest/aws-gc_$(uname -m | sed "s/arm64/aarch64/")-unknown-linux-musl.tar.xz" | sudo tar -xJf - -C /usr/local/bin
13+
14+
aws-gc destroy --tag elastio:resource=true --id-pattern elastio
15+
```
16+
17+
## Windows
18+
19+
```bash
20+
Invoke-WebRequest "https://dl.cloudsmith.io/public/elastio/public/raw/versions/latest/aws-gc_x86_64-pc-windows-msvc.zip" -OutFile "aws-gc.zip";
21+
Expand-Archive -Force "aws-gc.zip";
22+
Move-Item -Force "./aws-gc/aws-gc.exe" "./aws-gc.exe";
23+
Remove-Item -Force "./aws-gc", "./aws-gc.zip";
24+
25+
./aws-gc.exe destroy --tag elastio:resource=true --id-pattern elastio
26+
```
27+
28+
## MacOS
29+
30+
```bash
31+
curl -fLS "https://dl.cloudsmith.io/public/elastio/public/raw/versions/latest/aws-gc_$(uname -m | sed "s/arm64/aarch64/")-apple-darwin.tar.xz" | sudo tar -xJf - -C /usr/local/bin
32+
33+
aws-gc destroy --tag elastio:resource=true --id-pattern elastio
34+
```
35+
36+
## Troubleshooting
37+
38+
### Premature Cloudshell Session Termination
39+
40+
If AWS Cloudshell is terminating before `aws-gc` completes, then try restarting it again. The cleanup script is idempotent, so if it's aborted in the middle the deletion progress won't be undone. You can also limit the regions where it discovers the resources with the `--regions` parameter to speed up `aws-gc` a bit.
41+
42+
As a fallback try running the cleanup from your local machine.

0 commit comments

Comments
 (0)