check if dict bugfix
@@ -18,12 +18,13 @@ class CloudfrontDistributionEncryption(BaseResourceCheck):
:return: <CheckResult>
"""
if "default_cache_behavior" in conf.keys():
+ if isinstance(conf["default_cache_behavior"][0], dict):
default_viewer_policy = conf["default_cache_behavior"][0]["viewer_protocol_policy"][0]
if default_viewer_policy == "allow-all":
return CheckResult.FAILED
if "ordered_cache_behavior" in conf.keys():
for behavior in conf["ordered_cache_behavior"]:
- if type(behavior) is dict:
+ if isinstance(behavior, dict):
# behavior which is a string will return PASSED
if behavior["viewer_protocol_policy"][0] == "allow-all":
return CheckResult.FAILED
