in table_tagger.py [0:0]
def eponymously_tag_all_tables(self, tag_name:str, table_names:list, dry_run:bool) -> list:
"""Tag all tables in the region with their own name if not already tagged."""
tagged_tables = []
for table_name in table_names:
table_arn = self.table_utility.get_table_arn(table_name)
table_tags = self.table_utility.get_table_tags(table_arn=table_arn)
if tag_name not in table_tags:
name_tag = [{'Key': tag_name, 'Value': table_name}]
if not self.args.dry_run:
self.table_utility.add_tags_to_table(table_arn, name_tag)
logging.info(f"table_tagger: Tagged {table_arn} with Key: {tag_name}, Value: {table_name}")
tag_info = {'table_arn': table_arn,
'tag_key': tag_name,
'tag_value': table_name}
tagged_tables.append(tag_info)
return tagged_tables