How can I specify routing policy via the boto3 change_resource_record_sets function?

Viewed 53

When I create a record in my hosted zone via the AWS Web Console, I can select the Routing Policy as "Simple".

When I try to create the same record programmatically via boto3, I seem to have no option to set a Routing Policy, and it is "Latency" by default.

What am I missing?


    r53.change_resource_record_sets(
            HostedZoneId=hz_id,
            ChangeBatch={
                'Changes': [{
                    'Action': 'UPSERT',
                    'ResourceRecordSet': {
                        'Name': root_domain,
                        'Type': 'A',
                        'Region': region,
                        'AliasTarget': {
                            'DNSName': f's3-website.{region}.amazonaws.com',
                            'EvaluateTargetHealth': False,
                            'HostedZoneId': s3_hz_id,
                        },
                        'SetIdentifier': str(uuid.uuid4())
                    }
                }]
            }
        )

1 Answers

removing region and SetIdentifier works for me here - can't explain it though :)

Related