Skip to content

private zone handling is broken #2

Description

@csrl

# TODO validate
z_vpc_id = z.get('HostedZone', {}) \
.get('VPCs', {}) \
.get('VPC', {}) \
.get('VPCId', '')

The actual response contains (amongst other fields):

{'HostedZone': {'Id': '/hostedzone/ASDFASDFASDF', 'Name': 'asdfasdf.', 'Config': {'Comment': 'Internal domains', 'PrivateZone': True}, 'ResourceRecordSetCount': 56}, 'VPCs': [{'VPCRegion': 'us-east-1', 'VPCId': 'vpc-asdf1'}, {'VPCRegion': 'us-west-1', 'VPCId': 'vpc-asdf2'}, {'VPCRegion': 'us-west-1', 'VPCId': 'vpc-asdf3'}, {'VPCRegion': 'us-west-2', 'VPCId': 'vpc-asdf4'}]}

As such, it should iterate for each returned VPC in the list, something like:

    for v in z.get('VPCs', []):
        if requested_vpc_id and v['VPCId'] == requested_vpc_id:
            return data

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions