AWS S3 Lifecycle Rule | Guide - How to delete file from S3 after X days - tutorial

Поделиться
HTML-код
  • Опубликовано: 11 дек 2024

Комментарии • 37

  • @AtmnTime
    @AtmnTime 8 месяцев назад +4

    Almost every video explaining lifecycles use "Apply to all objects". I found only this one where proper use of prefix filters is present. Thank you for the clear explanation.

  • @dariuszk9543
    @dariuszk9543 2 года назад +4

    Fajny poradnik, poproszę więcej takich z AWS

  • @srilax01
    @srilax01 2 года назад +4

    thanks for the video !

    • @WojciechLepczynski
      @WojciechLepczynski  2 года назад +4

      Thank you for your message. I'm really glad it came in handy. I plan to record more cloud guides.

  • @tamaraIT
    @tamaraIT Год назад +3

    thanks for this video it is very helpful ❤

  • @hrishikeshmaluskar1224
    @hrishikeshmaluskar1224 8 месяцев назад +1

    Hi,
    The folder also gets deleted along with the files inside the folder.
    I just want to delete the files inside the folder, the folder should not get deleted.
    Is that possible?

    • @WojciechLepczynski
      @WojciechLepczynski  8 месяцев назад

      Hi, When you create a folder in Amazon S3, S3 creates a 0-byte object with a key that’s set to the folder name that you provided. If the object is deleted and there are no files using that path, then the folder will also disappear.
      In the article on my blog, or in a comment to this article, I provided a way to create the folder again.
      lepczynski.it/en/aws_en/automatically-delete-old-files-from-aws-s3/

  • @itpugil
    @itpugil 9 месяцев назад +1

    I looked up online and was shocked to read something like S3 deleting your files in 30 days, so does that mean that it'll only delete it if you create a policy? Otherwise the data stays there forever until you manually delete it?

    • @WojciechLepczynski
      @WojciechLepczynski  9 месяцев назад +2

      Yes. If you do nothing, your files will still be in S3. You can create a lifecycle policy as I described in the video and your unused files will be automatically deleted after the time you specify. It could be 30 days, a year or several years. This will save you time and money.
      If you need to store files for a long time but you don't use them, it's a good idea to familiarize yourself with the different storage classes for example aws.amazon.com/s3/storage-classes/glacier/

    • @itpugil
      @itpugil 9 месяцев назад +1

      @@WojciechLepczynski Thank you sir!

    • @WojciechLepczynski
      @WojciechLepczynski  9 месяцев назад +1

      Sure, no problem, if you have a question related to the movie, don't hesitate and write a comment.
      By the way, there will be another movie soon.
      You can find more information related to clouds and devops on my blog lepczynski.it/en .

  • @muhammadidham8824
    @muhammadidham8824 Год назад +1

    I set current version as it will move from standard to intelligent-tiering after 30 days, but the object didn't move to another that storage class. why???

    • @WojciechLepczynski
      @WojciechLepczynski  Год назад +2

      there could be many reasons, I would check the prefix first,
      theoretically you can move objects from Standard storage class to any other storage class, but S3 does not transition objects that are smaller than 128 KB, the time is counted from the last change of the file, you may have a lot of files and the transfer takes a long time...

  • @muhamadasep4654
    @muhamadasep4654 2 года назад +1

    i want to ask if you implement lifecyle policy. do lp apply to exisiting file or only new file upload ?

    • @WojciechLepczynski
      @WojciechLepczynski  2 года назад +2

      When you add a Lifecycle configuration to a bucket, the configuration rules apply to both existing objects and objects that you add later.
      For example, if you add a Lifecycle configuration rule today with an expiration action that causes objects with a specific prefix to expire 30 days after creation, Amazon S3 will queue for removal any existing objects that are more than 30 days old.

  • @saiireddy8818
    @saiireddy8818 2 года назад +1

    Thanks alot for sharing

  • @RRc29
    @RRc29 Год назад

    why us not working in my current fliles? I add a tule of 7 days expiration

    • @WojciechLepczynski
      @WojciechLepczynski  Год назад +1

      Hi, you provided very little information about your configuration, but I'll try to help.
      - If you added a prefix, you can check it for typos or other errors.
      - You can check if you have selected a good option regarding what you want to do with the data.
      - Amazon S3 runs lifecycle rules once every day.
      - However, rules might take a few days to run before the bucket is empty because expiring object versions and cleaning up delete markers are asynchronous steps.
      If that doesn't help, you can check the documentation

  • @maneeshreddy7952
    @maneeshreddy7952 Год назад +1

    What if I want to delete the file after 5 minutes it is created?

    • @WojciechLepczynski
      @WojciechLepczynski  Год назад +2

      then lifecycle rules is not a good choice because it runs once a day :)
      Amazon S3 runs lifecycle rules once every day. After the first time that Amazon S3 runs the rules, all objects that are eligible for expiration are marked for deletion. You're no longer charged for objects that are marked for deletion.

    • @WojciechLepczynski
      @WojciechLepczynski  Год назад +3

      You can check other ways.
      In this video you will find 7 different ways: ruclips.net/video/SckbCTULsHM/видео.html

  • @jorgepadilla1048
    @jorgepadilla1048 Год назад +1

    I tried it and the rule deleted the folder too D:

    • @WojciechLepczynski
      @WojciechLepczynski  Год назад +2

      Hi, When you create a folder in Amazon S3, S3 creates a 0-byte object with a key that’s set to the folder name that you provided. If the object is deleted and there are no files using that path, then the folder will also disappear.
      You can add a filter to your Lifecycle rule, and "Specify minimum object size" and only delete objects > 0 bytes. I expect your 0-sized objects will remain, but I didn't test it. Once you check it, you can let me know if it works ;)

  • @shrinidhig3672
    @shrinidhig3672 Год назад +1

    background music to loud. unable to get clearly what ur saying

  • @fonsecaedson
    @fonsecaedson Год назад +1

    good!

  • @bezeljosephjacob7514
    @bezeljosephjacob7514 Год назад +1

    Thanks

  • @infavr661
    @infavr661 Год назад

    It didn't work

    • @WojciechLepczynski
      @WojciechLepczynski  Год назад +1

      Hey, what exactly is not working, video or any of the methods? Can you provide more details? What method did you try, did you check if you have the right permissions?
      If something doesn't work, please provide more details about what exactly doesn't work and I'll try to verify it and help.

    • @infavr661
      @infavr661 Год назад

      @@WojciechLepczynski I followed this tutorial but the file in the folder didn't remove.

    • @WojciechLepczynski
      @WojciechLepczynski  Год назад +3

      @@infavr661 maybe you made a typo in the path, best to check all the steps again. You can check the blog article for more details lepczynski.it/en/aws_en/automatically-delete-old-files-from-aws-s3 .
      If you are sure that you did not make any mistakes then the only thing left to do is documentation or contact technical support