Remove/destroy Wasp Fly.io deployment
I created a simple Wasp app and tested deploying it to Fly.io and it all worked great. As it was just a silly experiment, I'd like to now take down (decommission) the deployment. Is this something I can do through the Wasp CLI, or do I need to use the fly cli directly to do this? Any guidance would be greatly appreciated. Thanks!
7 Replies
Hi @tomhh. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Currently, the Wasp CLI does not provide a built-in command to remove or destroy a Fly.io deployment. To decommission your Wasp app from Fly.io, you will need to use the Fly.io CLI (flyctl) directly.
The recommended approach is:
1. Identify the names of the apps you want to destroy. Wasp typically creates three apps on Fly.io for a project:
-
You can confirm these in your Fly.io dashboard or from the TOML files generated in your project root (
-
<your-app-name>-client
- <your-app-name>-server
- <your-app-name>-dbYou can confirm these in your Fly.io dashboard or from the TOML files generated in your project root (
fly-server.toml, fly-client.toml) Deploying with the Wasp CLI > Deploying.
2. Use the Fly.io CLI to destroy each app:
For example:
This will remove the deployed resources from your Fly.io account Set Up a Fly.io App.
If you encounter issues (e.g., Fly not allowing you to create new apps with the same name in the future), destroying the old apps as above is the recommended solution.
In summary: use the Fly.io CLI (flyctl) to destroy your Wasp app deployments, as Wasp CLI does not currently support this operation directly.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @tomhh, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?I'll report back once I've tested this to confirm if the instructions work as expected
Hey @tomhh. Yes, the bot is right 🙂
We do not provide a way to do this through the Wasp CLI. Do you think it makes sense we do?
Hi @sodic, apologies I'm only now just responding, I got distracted and am just getting back to this now.
I can confirm the commands suggested worked great, and the app is now destroyed.
Regarding your question, I think this would be nice if it's not too big of a hassle. My use case was following a Wasp tutorial (the one where you build an AI meme generator). I got this working with the latest version of Wasp (see this GitHub repo). I then wanted to test deploying it so I could share it, but I didn't want it to stick around forever (it was just a quick test).
In this situation, having a way to quickly decommission the app using the Wasp CLI would be really nice, as then the operations are symmetric. I know normally it's pretty rare someone wants to totally destroy their freshly created web app, but for quick tests like this it would be really useful. At the very least it would be good if the docs explicitly mentioned that you need to use
flyctl directly to clean-up an app if you want to destroy it, and no such command currently exists through the Wasp CLI.
Thanks!I think it makes sense on a conceptual level: you create a Wasp app, so you want to destory a Wasp app (and not destory 3 separate services). The fact that this is a quite destructive operation makes me wary of adding it to the Wasp CLI - but I guess if we ask you "Are you really sure" it should be less dangerous.
It would be
wasp deploy fly destroy or something like that.That sounds cool, yes having the CLI follow already established conventions on destructive operations (either confirmation, or requesting the user to retype the name of the app like happens in AWS for example) would be good
Wohooo @tomhh, you just became a Waspeteer level 1!