My purpose is to list all records available in all hosted zones. I created a listResourceRecordSetsRequest builder object and pass it through the response method to retrieve all the resource records but for some reason I get an error.
My code which is wrong and causing the error:
The line which starts with def response = ....
is what's giving an error
ArrayList<ResourceRecordSet> getResourceRecords(HostedZone hostedZone){
def request = ListResourceRecordSetsRequest.builder().hostedZoneId(hostedZone.id()).maxItems("1000").build()
def response = route53Client.listResourceRecordSets(request as Consumer<ListResourceRecordSetsRequest.Builder>)
return response.resourceRecordSets()
}
Error:
groovy.lang.MissingMethodException: No signature of method: software.amazon.awssdk.services.route53.model.ListResourceRecordSetsRequest.accept() is applicable for argument types: (software.amazon.awssdk.services.route53.model.ListResourceRecordSetsRequest$BuilderImpl) values: [software.amazon.awssdk.services.route53.model.ListResourceRecordSetsRequest$BuilderImpl@56eafaa0]
I appreciate the help in advance!
question from:
https://stackoverflow.com/questions/65837245/list-resource-record-sets-from-hosted-zone-in-route53-giving-a-very-weird-error 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…