Skip to content

Commit

Permalink
associations-cache_clusters (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielsoltz committed Mar 27, 2024
1 parent e3cf04d commit e04155c
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions lib/context/resources/Base.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,29 @@ def check_associated_resources(resource, level, drilled_source_resource_arn):
resource_drilled, 1, self.resource_arn
)

# ElasticCache CacheClusters
if (
hasattr(resource, "cache_clusters")
and resource.cache_clusters
and self.resource_type != "AwsElastiCacheCacheCluster"
):
from lib.context.resources.AwsElastiCacheCacheCluster import (
Metacheck as CacheClusterMetacheck,
)

for r, v in list(resource.cache_clusters.items()):
# Check if not a circular reference
if r != drilled_source_resource_arn:
resource_drilled_output, resource_drilled = execute(
r, CacheClusterMetacheck
)
resource.cache_clusters[r] = resource_drilled_output
self.all_associations[r] = resource_drilled_output
if level < max_level and resource_drilled:
check_associated_resources(
resource_drilled, level + 1, resource.resource_arn
)

self.all_associations = {}
check_associated_resources(self, 0, self.resource_arn)

Expand Down

0 comments on commit e04155c

Please sign in to comment.