I am migrating a zone (eg. example.com) from on-premise DNS server to Route 53. The zone has a TXT record with multiple values for example.com. Similarly, it has TXT records for several subdomains (eg. client.example.com, mails.example.com) under the same zone.
I created separate TXT records for each subdomain as it was previously present in the on-premise DNS server and using simple routing. But AWS documentation asks to include all values for a domain or subdomain in the same TXT record, but doesn't give any example or explain why it is needed.
Is it mandatory to give all TXT records for the domain and subdomain in single TXT record while using simple routing? If so, how to specify the subdomain names?
You're misunderstanding that documentation. It is just saying all TXT values for a specific domain, or a specific subdomain, have to be in a single TXT record entry in Route53. So for all the TXT values for the root domain, you would add those as a single TXT record in Route53. For all the TXT values for a subdomain, you would create one more TXT record for that subdomain, containing all those TXT values.