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:
--force option to env delete so all deployed services will be deleted from the environment and then the environment itself will be deleted--app to svc delete and requiring either --app _or_ --env ā this will help users learn that they have these different optionssvc undeploy would be very helpful in terms of learnability, UX, semantics, etc.Thanks!
Most helpful comment
Another use case for this subcommand: I want to delete an environment, but I canāt because a service is deployed to it:
(I donāt know why the service is listed twice.)
Thatās reasonable (although I wish there was a
--forceoption) but now what? Since thereās no command to āundeployā a service from an environment, as far as I can tell I need to runcopilot svc deletewhich prompts me with: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 helpand noticed the--envoption, and the _Examples_ section of the help output (which is fantastic BTW) included this: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:
--forceoption toenv deleteso all deployed services will be deleted from the environment and then the environment itself will be deleted--apptosvc deleteand requiring either--app_or_--envā this will help users learn that they have these different optionssvc undeploywould be very helpful in terms of learnability, UX, semantics, etc.Thanks!