File tree Expand file tree Collapse file tree 4 files changed +59
-1
lines changed Expand file tree Collapse file tree 4 files changed +59
-1
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,8 @@ aws-nuke run --feature-flag "wait-on-dependencies"
20
20
21
21
## Available Feature Flags
22
22
23
+ - ` filter-groups ` - This feature flag will cause aws-nuke to filter based on a grouping method which allows for AND'ing
24
+ filters together.
23
25
- ` wait-on-dependencies ` - This feature flag will cause aws-nuke to wait for all resource type dependencies to be
24
26
deleted before deleting the next resource type.
25
27
@@ -32,4 +34,21 @@ an attached policy.
32
34
The problem is that if you delete the IAM Role first, it will fail because it has a dependency on the policy.
33
35
34
36
This feature flag will cause aws-nuke to wait for all resources of a given type to be deleted before deleting the next
35
- resource type. This will reduce the number of errors and unnecessary API calls.
37
+ resource type. This will reduce the number of errors and unnecessary API calls.
38
+
39
+ ### filter-groups
40
+
41
+ This feature flag will cause aws-nuke to filter resources based on a group method. This is useful when filters need
42
+ to be AND'd together. For example, if you want to delete all resources that are tagged with ` env:dev ` and ` namespace:test `
43
+ you can use the following filter group:
44
+
45
+ ``` yaml
46
+ filters :
47
+ ResourceType :
48
+ - property : tag:env
49
+ value : dev
50
+ group : group1
51
+ - property : tag:namespace
52
+ value : test
53
+ group : group2
54
+ ` ` `
Original file line number Diff line number Diff line change @@ -21,6 +21,33 @@ against some resources and not others.
21
21
Global works by taking all filters defined under ` __global__ ` and prepends to any filters found for a resource type. If
22
22
a resource does NOT have any filters defined, the ` __global__ ` ones will still be used.
23
23
24
+ ## Filter Groups
25
+
26
+ !!! important
27
+ Filter groups are an experimental feature and are disabled by default. To enable filter groups, use the
28
+ ` --feature-flag filter-groups ` flag.
29
+
30
+ Filter groups are used to group filters together. This is useful when filters need to be AND'd together. For example,
31
+ if you want to delete all resources that are tagged with ` env:dev ` and ` namespace:test ` you can use the following filter
32
+ group:
33
+
34
+ ``` yaml
35
+ filters :
36
+ ResourceType :
37
+ - property : tag:env
38
+ value : dev
39
+ group : group1
40
+ - property : tag:namespace
41
+ value : test
42
+ group : group2
43
+ ` ` `
44
+
45
+ In this example, the ` group1` and `group2` filters are AND'd together. This means that a resource must match both filters
46
+ to be excluded from deletion.
47
+
48
+ Only a single filter in a group is required to match. This means that if a resource matches any filter in a group it will
49
+ count as a match for the group.
50
+
24
51
# ## Example
25
52
26
53
In this example, we are ignoring all resources that have the tag `aws-nuke` set to `ignore`. Additionally filtering
Original file line number Diff line number Diff line change
1
+ # Filter Groups
2
+
3
+ !!! important
4
+ This feature is experimental and is disabled by default. To enable it, use the ` --feature-flag "filter-groups" ` CLI argument.
5
+
6
+ Filter groups allow you to filter resources based on a grouping method which allows for AND'ing filters together. By
7
+ default, all filters belong to the same group, but you can specify a group name to group filters together.
8
+
9
+ All filters within a group are OR'd together, and all groups are AND'd together.
10
+
11
+ [ Full Documentation] ( ../config-filtering.md#filter-groups )
Original file line number Diff line number Diff line change 77
77
- Overview : features/overview.md
78
78
- Bypass Alias Check : features/bypass-alias-check.md
79
79
- Global Filters : features/global-filters.md
80
+ - Filter Groups : features/filter-groups.md
80
81
- Enabled Regions : features/enabled-regions.md
81
82
- Signed Binaries : features/signed-binaries.md
82
83
- CLI :
You can’t perform that action at this time.
0 commit comments