fix(aws): list tags for DocumentDB clusters (#6621)

Co-authored-by: Kay Agahd <kagahd@users.noreply.github.com>
This commit is contained in:
Prowler Bot
2025-01-20 22:28:41 +01:00
committed by GitHub
parent 967969288f
commit a591beb1bb
2 changed files with 12 additions and 1 deletions
@@ -65,6 +65,17 @@ class DocumentDB(AWSService):
def _list_tags_for_resource(self):
logger.info("DocumentDB - List Tags...")
try:
for cluster_arn, cluster in self.db_clusters.items():
try:
regional_client = self.regional_clients[cluster.region]
response = regional_client.list_tags_for_resource(
ResourceName=cluster_arn
)["TagList"]
cluster.tags = response
except Exception as error:
logger.error(
f"{regional_client.region} -- {error.__class__.__name__}[{error.__traceback__.tb_lineno}]: {error}"
)
for instance_arn, instance in self.db_instances.items():
try:
regional_client = self.regional_clients[instance.region]
@@ -179,7 +179,7 @@ class Test_DocumentDB_Service:
parameter_group="default.docdb3.6",
deletion_protection=True,
region=AWS_REGION_US_EAST_1,
tags=[],
tags=[{"Key": "environment", "Value": "test"}],
)
}