I'm having a problem with the changeResourceRecordSets API call.
My record has multiple MX values. When I call the API I can get it to add 1 MX record, but I cannot get it to add multiple values.
For example:
['ResourceRecordSet']['Name'] = 'mytest.com';
['ResourceRecordSet']['Type'] = 'MX';
['ResourceRecordSet']['TTL'] = 3600;
['ResourceRecordSet']['ResourceRecords']['Value'] = array("Value"=>'10 mx1.emailsrvr.com');
Works for one record.
I've tried:
['ResourceRecordSet']['ResourceRecords']['Value'] = array("Value"=>'10 mx1.emailsrvr.com', '20 mx2.emailsrvr.com');
But this will only add one record, not both.
How do I add both records?
The official AWS documentation states that each value would be its own array, so the structure would look similar to the below
ResourceRecords is actually an array of values, rather than needing a key of "Value". Each of these will be looped over and added to your record.