怎么可能一个假设IAM作用使用IAM用户证?
import boto3
sts_client = boto3.client(
'sts',
aws_access_key_id=ACCESS_KEY,
aws_secret_access_key=SECRET_KEY,
)
)
sts_client.assume_role(RoleArn=some-role, RoleSessionName='boto3_client')
上述代码,由于某些原因产生:
An error occurred (InvalidClientTokenId) when calling the AssumeRole operation: The security token included in the request is invalid.
我已经测试过的 aws_access_key_id
和 aws_secret_access_key
使用 aws sts assume-role
和我的确可以发挥这一作用使用CLI。 我做错了什么?
如果它使得有任何区别,IAM用户是在中国分区的限。