Fix cloudformation error when stack-rollback fails (#5550)

In cases where a CFN stack could not complete (due to lack of
permissions or similar) but also failed to roll back, the gathering of
stack resources would fail because successfully deleted items in the
rollback would no longer have a `PhysicalResourceId` property.

This PR fixes that by soft-failing when there's no physical ID
associated to a resource.
This commit is contained in:
Ryan Brown 2016-11-10 11:32:32 -05:00 committed by Matt Clay
parent bf9077bfad
commit e45e25c257

View file

@ -473,7 +473,7 @@ def main():
for res in reslist.get('StackResourceSummaries', []):
stack_resources.append({
"logical_resource_id": res['LogicalResourceId'],
"physical_resource_id": res['PhysicalResourceId'],
"physical_resource_id": res.get('PhysicalResourceId', ''),
"resource_type": res['ResourceType'],
"last_updated_time": res['LastUpdatedTimestamp'],
"status": res['ResourceStatus'],