Skip to content
This repository was archived by the owner on Oct 23, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions senza/manaus/cloudformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ def resources(self) -> Iterator:
for resource in resources:
resource_type = resource["ResourceType"]
if resource_type == ResourceType.route53_record_set:
physical_resource_id = resource.get('PhysicalResourceId')
if physical_resource_id is None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should just check if the status is DELETE_COMPLETE? Sounds more contextualised than we cannot check because there is no key found in the dict.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some resources with delete_complete have a PhysicalResourceId. From the same stack trace:

{'LastUpdatedTimestamp': datetime.datetime(..), 
 'LogicalResourceId': 'xxxLBSecurityGroup', 
 'PhysicalResourceId': 'xxx-xxx-xx-xxxBSecurityGroup-xxxxxx', 
 'ResourceStatus': 'DELETE_COMPLETE', 
 'ResourceType': 'AWS::EC2::SecurityGroup' }

Granted none of them are Route53 records but I couldn't find documentation on this.

# if there is no Physical Resource Id we can't fetch the
# record
continue
records = Route53.get_records(name=resource['PhysicalResourceId'])
for record in records:
if (record.set_identifier is None or
Expand Down
6 changes: 6 additions & 0 deletions tests/test_manaus/test_cloudformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ def test_cf_resources(monkeypatch):
'PhysicalResourceId': 'myapp1.example.com',
'ResourceStatus': 'CREATE_COMPLETE',
'ResourceType': 'AWS::Route53::RecordSet'},
{'LastUpdatedTimestamp': datetime(2016, 7, 20, 7, 3,
45, 70000,
tzinfo=timezone.utc),
'LogicalResourceId': 'ThisWillBeIgnored',
'ResourceStatus': 'CREATE_COMPLETE',
'ResourceType': 'AWS::Route53::RecordSet'},
{'LastUpdatedTimestamp': datetime(2016, 7, 20, 7, 3,
43, 871000,
tzinfo=timezone.utc),
Expand Down