Harshit Gupta
Harshit Gupta

Reputation: 11

How to Search through AWS Route53 Domain records through boto3 sdk?

I want a webpage listing all the Records in a hosted zone from AWS Route 53 and use all the operations like Search, Add and Edit on those records.

Till now, I am able to list all the records using list_resource_record_sets(), also able to Add and Edit a record using change_resource_record_sets().

But the problem is with searching. I am not able to find any parameter or function for Searching through all the records and get all matching results. The searching should be like it is in AWS console.

How to implement this searching part?

Upvotes: 1

Views: 1151

Answers (1)

Mircea
Mircea

Reputation: 10566

you already found it. It's the list_resource_records_sets

https://docs.aws.amazon.com/Route53/latest/APIReference/API_ListResourceRecordSets.html

or boto: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/route53.html#Route53.Client.list_resource_record_sets

you can pass in additional arguments that narrow down what you are listing. Thisis what the console does.

response = client.list_resource_record_sets(
    HostedZoneId='string',
    StartRecordName='string',
    StartRecordType='SOA'|'A'|'TXT'|'NS'|'CNAME'|'MX'|'NAPTR'|'PTR'|'SRV'|'SPF'|'AAAA'|'CAA'|'DS',
    StartRecordIdentifier='string',
    MaxItems='string'
)

Upvotes: 1

Related Questions