Git Product home page Git Product logo

Comments (9)

bjoernhaeuser avatar bjoernhaeuser commented on June 3, 2024

Probably most of the requirements could be fulfilled by simple glob style matching, right?

I would go for the first solution (type: regex).

from aws-nuke.

svenwltr avatar svenwltr commented on June 3, 2024

Probably most of the requirements could be fulfilled by simple glob style matching, right?

Do you mean like this?

accounts:
  "00000000000":
    filters:
      S3Bucket:
      - "s3://my-bucket/b*sh.txt"

This would work, but I do not see any guarantee that the wildcard * will never be part of an resource identifier.

And if you mean it like this:

accounts:
  "00000000000":
    filters:
      S3Bucket:
      - type: glob
        id: "s3://my-bucket/b*sh.txt"

This would be easy to implement, if we have the basic code foundation.

from aws-nuke.

bjoernhaeuser avatar bjoernhaeuser commented on June 3, 2024

I meant it like this:

accounts:
  "00000000000":
    filters:
      S3Bucket:
      - type: glob
        id: "s3://my-bucket/b*sh.txt"

from aws-nuke.

svenwltr avatar svenwltr commented on June 3, 2024

Probably we should implement both (which is easy), because globs are easier to write and regex has the full functionality.

from aws-nuke.

tomvachon avatar tomvachon commented on June 3, 2024

from aws-nuke.

tomvachon avatar tomvachon commented on June 3, 2024

@svenwltr this should be available to more than S3 buckets, it a highly useful update

from aws-nuke.

svenwltr avatar svenwltr commented on June 3, 2024

@tomvachon Yes, it is intended to be available to all resources. Actually, implementing it for S3 Buckets only would be even harder.

from aws-nuke.

bethge avatar bethge commented on June 3, 2024

I very much like this proposal. Regex / glob would greatly simplify things. The old format would become the shorthand for the new type: exact format (this is just rephrasing it from a conceptual view).

This map should contain a type and optionally the data for the filter.

Why do you want to make the data field for the filter optional? What would be the default value?

Being rather nitpicky:

 accounts:
   "00000000000":
     filters:
       S3Bucket:
       - regex: "s3://my-bucket/b[iao]sh\\.txt"

How come we would need two \ to escape the .?

from aws-nuke.

svenwltr avatar svenwltr commented on June 3, 2024

This map should contain a type and optionally the data for the filter.

Why do you want to make the data field for the filter optional? What would be the default value?

Probably depending on the type, but for exact, glob and regex they should be mandatory. Ok it is unlikely that this will be optional.

How come we would need two \ to escape the .?
One for escaping the \ in YAML and the next one for actually escaping the . in the regex.

from aws-nuke.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.