[LYN-4743] Add CFN resource attribute key check (#1528)

This commit is contained in:
Vincent Liu
2021-06-24 12:01:11 -07:00
committed by GitHub
parent b3978c19d2
commit bd9c0d41b8
2 changed files with 24 additions and 4 deletions
@@ -179,10 +179,11 @@ def list_cloudformation_stack_resources(stack_name, region=None) -> List[BasicRe
# iterate through page iterator to fetch all resources
resource: Dict[str, any]
for resource in page["StackResourceSummaries"]:
resource_type_and_name.append(BasicResourceAttributesBuilder()
.build_type(resource["ResourceType"])
.build_name_id(resource["PhysicalResourceId"])
.build())
if "ResourceType" in resource.keys() and "PhysicalResourceId" in resource.keys():
resource_type_and_name.append(BasicResourceAttributesBuilder()
.build_type(resource["ResourceType"])
.build_name_id(resource["PhysicalResourceId"])
.build())
if iterator.resume_token is None:
# when resume token is none, it means there is no more resources left
break