Feature request: new subcommand `svc undeploy`
While iterating on an environment, an app, a service, and for various reasons, I sometimes wish to “undeploy” a service without actually “deleting” it.
For example, if I want to take down a service over the weekend when I won’t be working with it.
Thanks!
(This feels somewhat related to #1381 wherein I hadn’t realized that after running svc delete I’d need to run svc init again, to redeploy it, even though I already have a manifest file.)
One thing you can do in the mean time is set the desired count to 0 and deploy it. That'll bring your service down to 0 tasks.
Great suggestion — thanks!
Another use case for this subcommand: I want to delete an environment, but I can’t because a service is deployed to it:
$ copilot env delete -n avi-test --profile pw-dev --yes <aws:pw-dev>
✘ service 'shared-infra, shared-infra' still exist within the environment avi-test
(I don’t know why the service is listed twice.)
That’s reasonable (although I wish there was a --force option) but now what? Since there’s no command to “undeploy” a service from an environment, as far as I can tell I need to run copilot svc delete which prompts me with:
$ copilot svc delete --name shared-infra
Are you sure you want to delete shared-infra from application plotwatt? [? for help] (y/N)
Which is definitely not what I want to do; I have this service deployed to other environments. And even if I didn’t, I don’t want to delete it from the application, I just want to undeploy it.
Wait, though — I just ran copilot svc delete help and noticed the --env option, and the Examples section of the help output (which is fantastic BTW) included this:
Delete the "test" service from just the prod environment.
`$ copilot svc delete --name test --env prod`
which is great … that seems to be almost exactly what I’m looking for, at least in concrete terms if not in semantics.
So now I just have a few suggestions:
- I suggest adding
--forceoption toenv deleteso all deployed services will be deleted from the environment and then the environment itself will be deleted - I suggest adding the option
--apptosvc deleteand requiring either--appor--env— this will help users learn that they have these different options - I still think a new subcommand
svc undeploywould be very helpful in terms of learnability, UX, semantics, etc.
Thanks!
I have to agree and would also like an svc undeploy. It makes sense since creating a service doesn't mean it's deployed. The other way around you cannot undeploy currently, only completely delete.
I am looking for the same feature.