Boto3在使用update_service_specific_credential时获取InvalidClientTokenId

时间:2019-01-03 09:52:29

标签: python amazon-web-services boto3 amazon-iam aws-iam

我想使用Boto3将AWS CodeCommit的Git凭据更改为活动/不活动。

我尝试使用update_service_specific_credential,但出现此错误:

An error occurred (InvalidClientTokenId) when calling the CreateServiceSpecificCredential operation: The security token included in the request is invalid: ClientError

我的代码:

iamClient = boto3.client('iam')

response=iamClient.update_service_specific_credential(UserName="****",
ServiceSpecificCredentialId="*****",Status="Active")

有人尝试使用它吗? 有什么建议吗?

谢谢!

1 个答案:

答案 0 :(得分:0)

AWS错误通常是故意不透明/非特定的,因此您能否提供更多详细信息?特别是,执行更新的用户和要更新其凭证的用户是两个不同的用户吗?如果要更新的用户是执行更新的用户,则可能会出现竞争状况。