小编ShK*_*ShK的帖子

使用 ChangeResourceRecordSets Boto3 删除/更新插入时,Change 中缺少字段“SetIdentifier”

我花了一周的时间尝试使用 Boto3 v1.10.39 删除/更新插入简单的 Route 53 资源记录。

我的代码:

resp=r53_client.change_resource_record_sets(
    HostedZoneId=<ZONE_ID>,
    ChangeBatch={
        'Comment': 'del_ip',
        'Changes': [
            {
                'Action': 'DELETE',
                'ResourceRecordSet': {
                    'Name': <SUBDOMAIN>,
                    'Type': 'A',
                    'Region': 'us-east-1',
                    'TTL': 300,
                    'ResourceRecords': [{'Value': <OLD_IP>}]
                }
            }
        ]
    }
)
Run Code Online (Sandbox Code Playgroud)

错误消息:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/botocore/client.py", line 272, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/usr/lib/python2.7/dist-packages/botocore/client.py", line 576, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.errorfactory.InvalidInput: An error occurred (InvalidInput) when calling the ChangeResourceRecordSets operation: Invalid request: Missing field …
Run Code Online (Sandbox Code Playgroud)

python-2.7 amazon-route53 aws-cli boto3

2
推荐指数
1
解决办法
1889
查看次数

标签 统计

amazon-route53 ×1

aws-cli ×1

boto3 ×1

python-2.7 ×1