I'm trying to create a record set with the aws sdk and I'm getting this validation error:
Validation errors: [ChangeBatch][Changes][0][Change][ResourceRecordSet][ResourceRecords][Value][ResourceRecord] must be of type object
My code looks like this:
$result = $r53->changeResourceRecordSets(array(
'HostedZoneId' => 'XXXXXXXXXXXXXXX',
'ChangeBatch' => array(
'Changes' => array(
array(
'Action' => 'CREATE',
'ResourceRecordSet' => array(
'Name' => 'psion',
'Type' => 'CNAME',
'ResourceRecords' => array(
'Value' => 'example.com'
),
),
'Change' => array(
'ResourceRecordSet' => array(
'ResourceRecords' => array(
'Value' => array(
'ResourceRecord' => $aws->get('Route53'),
),
),
),
),
),
),
),
));
Any idea what the validation error means?
Validation errors: [ChangeBatch][Changes][0][Change][ResourceRecordSet][ResourceRecords][Value][ResourceRecord] must be of type object.
By type "object", it means an associative array. This is a validation message bubbling up from the Guzzle layer.
Here are the API docs for Route53Client::changeResourceRecordSets()
, which shows an example of how the request should look when it is formatted correctly.
That whole array you have under the 'Change'
key is not correct at all.