Skip to content

Commit 4d9b110

Browse files
authored
Adding a check to verify taggable = True (#69)
1 parent 7adb753 commit 4d9b110

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

docs/BASIC_LINTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
|----------|-------------|------|
3939
| `check_if_taggable_is_used` | `TAG001` | `"'taggable' is deprecated, please used 'tagging' property"` |
4040
| `ensure_tagging_is_specified` | `TAG002` | `"'tagging' MUST be specified"` |
41+
| | `TAG015` | `"'tagging.taggable' MUST be True"` |
4142
| `ensure_taggable_and_tagging_do_not_coexist` | `TAG003` | `"'taggable' and 'tagging' MUST NOT coexist"` |
4243
| `ensure_property_tags_exists_v1` | `TAG004` | `"Resource MUST implement Tags property if 'taggable' is true"` |
4344
| `ensure_property_tags_exists_v2` | `TAG005` | `"'tagging' MUST BE a struct"` |

src/rpdk/guard_rail/rule_library/tags/schema-linter-core-tagging-rules.guard

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,17 @@ rule ensure_tagging_is_specified {
2020
"message": "`tagging` MUST be specified"
2121
}
2222
>>
23+
24+
when tagging exists {
25+
tagging.taggable == true
26+
<<
27+
{
28+
"result": "NON_COMPLIANT",
29+
"check_id": "TAG015",
30+
"message": "`tagging.taggable` MUST be true"
31+
}
32+
>>
33+
}
2334
}
2435

2536
rule ensure_taggable_and_tagging_do_not_coexist when taggable exists {

0 commit comments

Comments
 (0)