下面的脚本(简化的、虚构的区域/zoneid)在运行时会给出错误
botocore.errorfactory.InvalidInput: An error occurred (InvalidInput) when calling the ChangeResourceRecordSets operation: Invalid request
#!/usr/bin/python3.3
import boto3
ipaddress = '10.32.24.82'
zoneid = 'Z3GJIR73GHRHXX'
response = boto3.client('route53').change_resource_record_sets(
HostedZoneId=zoneid,
ChangeBatch={
'Comment': 'swarm manager',
'Changes': [
{
'Action': 'UPSERT',
'ResourceRecordSet':
{
'TTL': 600,
'Name': 'www.giganticwasteoftime.com.',
'SetIdentifier': 'abc1',
'Type': 'A'
'ResourceRecords':
[{'Value': ipaddress}, ],
}
}, ]
}
)
print(response)
我以前做过成功的python脚本来查询route53,但是我从来没有写过
我在boto3上进行了pip安装更新,但是这些版本的python模块却出现了完全相同的错误: boto3-1.4.4 botocore-1.5.56 docutils-0.13.1 jmespath-0.9.2 python-dateutil-2.6.0 s3transfer-0.1.10
这不是pythonlibs的问题,错误来自AWS。从您的请求中省略SetIdentifier,因为您正在创建一个记录;如果域www.gigancwasteoftime.com存在它应该工作。在
来自boto3 docs:
相关问题 更多 >
编程相关推荐