fix(terraform): correctly evaluate CKV_AWS_37 when there's a dynamic … #6792
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
User description
…block
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Description
For reasons that are beyond me,
enabled_cluster_log_types
is a list of strings normally, but when there's a dynamic block added to the resource it becomes a list of list of strings. This PR adds tests to confirm that this is indeed an issue (if you run the test file against the check in master then it fails onaws_eks_cluster.fully_enabled_with_dynamic_block
), and fixes the issue by checking the type before itterating.Checklist:
Generated description
Dear maintainer, below is a concise technical summary of the changes proposed in this PR:
Address an issue in the
EKSControlPlaneLogging
class where theenabled_cluster_log_types
configuration can be a list of lists when a dynamic block is present. This pull request modifies the logic to correctly evaluate the configuration by checking the type before iterating. Additionally, new test cases are added intest_EKSControlPlaneLogging.py
to ensure the fix is effective, including scenarios with dynamic blocks.Modified files (2)
Latest Contributors(2)
EKSControlPlaneLogging
to handle dynamic blocks correctly.Modified files (1)
Latest Contributors(2)