CLI command to list all deployed stages
See original GitHub issueCurrently info
or deploy list
inform about deployed endpoints and lambdas to current stage.
It’ll be great to be able to gather information about all deployed stages.
Use case is cleanup purposes. In our projects each CI deployment goes to different stage (so they do not collide in case of concurrency), each deployment is cleaned by CI, unless something goes wrong.
I’d like to be able to discover such abandoned stages and remove them via sls remove -s stageToRemove
.
- Serverless Framework Version you’re using: v1.17
- Operating System: macOS 10.12.5
Implementation proposal
Introduce sls list
command which should list all deployed services and stages.
- Should be implemented at
lib/plugins/aws/list.js
location. - Should be service agnostic (it’s irrelevant whether we call it in service context or not)
Processing flow:
- Show notice that it’s only services which rely on default serverless bucket and cloudformation stack name that are discvered
- Resolve all S3 buckets for given account, and find all having
{service}-{stage}-serverlessdeploymentbucket-
string - Limit list to those for which
{service}-{stage}
CloudFormation stack exist - List all discovered services, grouping them by service, stage and region
Issue Analytics
- State:
- Created 6 years ago
- Reactions:8
- Comments:26 (16 by maintainers)
Top Results From Across the Web
get-stages — AWS CLI 1.27.32 Command Reference
The stages ' deployment identifiers. --cli-input-json (string) Performs service operation based on the JSON string provided. The JSON string follows the format ...
Read more >list-stage-deployments — AWS CLI 2.8.10 Command Reference
Gets a paginated list of stage deployment summaries from the game. See also: AWS API Documentation. list-stage-deployments is a paginated operation.
Read more >Serverless Framework Commands - AWS Lambda - Deploy List
The sls deploy list [functions] command will list information about your deployments. You can either see all available deployments in your S3 deployment...
Read more >The Octopus Command Line (CLI)
list -latestdeployments: Lists the releases last-deployed in each environment. list-machines: Lists all machines. list-projects: Lists all ...
Read more >OpenShift CLI developer command reference
Run oc help to list all commands or run oc <command> --help to get ... by type/name in YAML. oc apply edit-last-applied deployment/nginx...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Verlet64 @horike37 @pmuens @medikoo I would not use the
--stage
option at all to enable listing of all stages, as the switch already has a fixed meaning and any values can clash with real stage names. The most stable approach would be to have an additional switch that will enable all stages. I consider reusing something that already has a specific meaning as bad behavior.So my proposal is: Add a
--all
switch to list everything. When given, the--stage
switch must not be specified. Soserverless info --all
would show all stages,serverless info
would show the default stage (if defined as provider.stage) andserverless info --stage=mystage
would show a specific stage. Same fordeploy list
.Cool, I’ll get started then.
I’ll let you know if i have any questions 😃