我正在尝试为托管区域创建记录集:
var params = {
ChangeBatch: {
Changes: [
{
Action: 'UPSERT',
ResourceRecordSet: {
Name: 'google5.com', //Domain name
Type: 'A',
ResourceRecords: [{
'Value': '52.255.255.255' //Instance Public IP
}]
}
}
]
},
HostedZoneId: '/hostedzone/Z0.....' //Hosted Zone ID
}
route53.changeResourceRecordSets(params, function(err, data) {
console.log(err);
});
我不断收到错误:InvalidInput:无效请求
我发现 TTL 属性丢失了,添加后它工作得很好,完整的示例:
var params = {
ChangeBatch: {
Changes: [
{
Action: 'UPSERT',
ResourceRecordSet: {
Name: 'google5.com', //Domain name
Type: 'A',
TTL: 86400, //Critical!
ResourceRecords: [{
'Value': '52.255.255.255' //Instance Public IP
}]
}
}
]
},
HostedZoneId: '/hostedzone/Z0.....' //Hosted Zone ID
}
route53.changeResourceRecordSets(params, function(err, data) {
console.log(err);
});
我是一名优秀的程序员,十分优秀!