mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-05 10:13:09 +00:00
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:
@@ -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'],
|
||||
|
||||
Reference in New Issue
Block a user