Skip to content

Enable to remove services just by providing their name to sls remove #2202

Open

Description

@flomotlik

This is a Feature Proposal

Description

For feature proposals:

  • What is the use case that should be solved. The more detail you describe this in the easier it is to understand for us.
  • If there is additional config how would it look

To remove a deployed service at the moment you need the serverless.yml file on your local system so you can run serverless remove. Over time different services might have been deployed into your infrastructure and its not possible to remove them easily through Cloudformation because the S3 buckets aren't empty. Thus we can add an option --service-name to the remove command that will skip the current serverless.yml config and simply remove the whole service.

Another option would be setting appropriate values on the S3 bucket CF deployment, so you can easily remove it through the CF UI (probably the even better solution)

Similar or dependent issues:
*

Additional Data

Activity

  1. nicka commented on Sep 25, 2016

    @nicka
    Contributor

    Are you thinking about the DeletionPolicy key within CloudFormation for the S3 bucket?

    Bit more complex solution: Adding a Custom Lambda backed CF resource which would empty the bucket upon stack deletion.

  2. flomotlik commented on Sep 26, 2016

    @flomotlik
    ContributorAuthor

    @nicka looks like a DeletionPolicy doesn't work here (which kind of sucks)

    Note
    For Amazon S3 buckets, you must delete all objects in the bucket for deletion to succeed.
    

    While a Custom lambda would be a nice addition solution, imho we shouldn't add additional resources and code into users infrastructure if not absolutely necessary. I think simply being able to set a name on the service with --service-name would be the best solution and we can still introduce more in the future in case users want to have this feature (or it could be added through a plugin)

  3. added this to the v1.0-ideas milestone on Sep 27, 2016
  4. modified the milestone: v1.0-ideas on Nov 4, 2016
  5. 4 remaining items

  6. changed the title [-]Make it easier to remove services from CF that you don't have files for locally[/-] [+]Enable to remove services just by providing their name to sls remove[/+] on Jul 22, 2020
  7. medikoo commented on Dec 7, 2021

    @medikoo
    Contributor

    It feels related to #8499 and I believe should be addressed in same context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions