Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

associations-cache_clusters #98

Merged
merged 1 commit into from
Mar 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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