diff --git a/changelog/57139.fixed b/changelog/57139.fixed new file mode 100644 index 00000000000..af460e9b2a7 --- /dev/null +++ b/changelog/57139.fixed @@ -0,0 +1 @@ +Fix boto_route53 issue with (multiple) VPCs. diff --git a/salt/states/boto_route53.py b/salt/states/boto_route53.py index bd31def50f4..0143c4e276f 100644 --- a/salt/states/boto_route53.py +++ b/salt/states/boto_route53.py @@ -526,8 +526,11 @@ def hosted_zone_present( create = True else: if private_zone: - for v, d in deets.get("VPCs", {}).items(): - if d["VPCId"] == vpc_id and d["VPCRegion"] == vpc_region: + vpcs = deets.get("VPCs", []) + if isinstance(vpcs, dict): + vpcs = vpcs.values() + for vpc in vpcs: + if vpc["VPCId"] == vpc_id and vpc["VPCRegion"] == vpc_region: create = False break else: