【发布时间】:2020-05-22 18:08:17
【问题描述】:
我需要列出所有帐户,然后将所有凭据写入我的~/.aws/credentials 文件中。首先,我使用boto3 的方式如下
import boto3
client = boto3.client('organizations')
response = client.list_accounts(
NextToken='string',
MaxResults=123
)
print(response)
这会失败并出现以下错误
botocore.exceptions.ClientError: An error occurred (ExpiredTokenException) when calling the ListAccounts operation: The security token included in the request is expired
问题是,它在看哪个令牌?如果我想了解所有帐户的信息,我应该在credentials 文件或config 文件中使用什么凭据?
【问题讨论】:
-
评论 NextToken='string', #NextToken='string',
-
没有任何区别,它从哪里读取凭据?
标签: token boto3 aws-organizations