diff --git a/.gitignore b/.gitignore index d7a14bda2..ac50e35b2 100644 --- a/.gitignore +++ b/.gitignore @@ -21,4 +21,4 @@ auditor/node_modules auditor/.cdk.staging auditor/cdk.out auditor/.env -auditor/resources/cloudmapper \ No newline at end of file +auditor/resources/cloudmapper diff --git a/commands/prepare.py b/commands/prepare.py index d303c6117..664ace478 100644 --- a/commands/prepare.py +++ b/commands/prepare.py @@ -458,12 +458,13 @@ def build_data_structure(account_data, config, outputfilter): # For a tag set, see if all conditions match, ex. [["Team","Dev"],["Name","Bastion"]] for pair in conditions: # Given ["Team","Dev"], see if it matches one of the tags in the node - for tag in node.tags: - if ( - tag.get("Key", "") == pair[0] - and tag.get("Value", "") == pair[1] - ): - condition_matches += 1 + if node.tags: + for tag in node.tags: + if ( + tag.get("Key", "") == pair[0] + and tag.get("Value", "") == pair[1] + ): + condition_matches += 1 # We have a match if all of the conditions matched if condition_matches == len(conditions): has_match = True