For hosted zone name: example.com, under RecordSets I want to add xyz.example.com. I want it to be of type TXT and CNAME with different ResourceRecord values for each type.
How can I achieve this?
This is forbidden in DNS so Route 53 does not allow it. You may create either a CNAME (only) or a combination of any other record type at a single domain.
The way to think about CNAME records in DNS is as a sort of redirect or symlink "All record types for $DOMAIN are located at $OTHER_DOMAIN". For that reason, if you create a CNAME, you cannot also create a TXT record, but you can and likely should create the the TXT record at the domain to which the CNAME refers.
DNS TXT record not propagatingasked 3 years ago
CNAME record problemAccepted Answerasked a month ago
Cannot create TXT record due to CNAME already existing?asked 7 months ago
TXT Records not resolvedasked 4 years ago
DNS TXT change stuck in pending for _amazonses entryasked 3 years ago
TXT and CNAME records both required for open and click tracking?asked 3 years ago
Route 53 domain cname record without hosted zoneAccepted Answerasked a year ago
CNAME and TXT type for same record.asked a year ago
TXT - 365 didn't detect the added TXT record for SPFasked a year ago
How do I resolve a DNS CNAME conflict from the AWS WordPress Plug-In tool for Cloudfront?asked 10 months ago