Skip to content

Commit

Permalink
fix(aws): list tags for DocumentDB clusters (#6605)
Browse files Browse the repository at this point in the history
  • Loading branch information
kagahd authored Jan 20, 2025
1 parent d04fd80 commit bbba0ab
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions prowler/providers/aws/services/documentdb/documentdb_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,17 @@ def _describe_db_instances(self, regional_client):
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]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def test_describe_db_clusters(self):
parameter_group="default.docdb3.6",
deletion_protection=True,
region=AWS_REGION_US_EAST_1,
tags=[],
tags=[{"Key": "environment", "Value": "test"}],
)
}

Expand Down

0 comments on commit bbba0ab

Please sign in to comment.