我正在打这样的电话ecs.create_service
:
createServiceResponse = ecs.create_service(
clientToken='abc123',
cluster=options.cluster,
serviceName=options.service,
desiredCount=1,
taskDefinition='relay:' + str(revision),
role='ecsServiceRole',
loadBalancers=[
{
'loadBalancerName': options.elb,
'containerName': 'relay',
'containerPort': 8080
}
]
)
请注意,clientToken 中的值目前是abc123
,但我尝试了各种不同的字符串。该文档说我需要提供它以确保幂等性(http://boto3.readthedocs.org/en/latest/reference/services/ecs.html)但是我不断收到此错误:
Traceback (most recent call last):
File "./deploy.py", line 103, in <module>
'containerPort': 8080
File "/usr/local/lib/python2.7/site-packages/botocore/client.py", line 301, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/usr/local/lib/python2.7/site-packages/botocore/client.py", line 386, in _make_api_call
raise ClientError(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (InvalidParameterException) when calling the CreateService operation: Creation of service was not idempotent.
为什么 ?