amazon-web-services - boto3 是否具有与 awscli 相当的凭证缓存?

标签 amazon-web-services boto3

使用 awscli 在 ~/.aws/cli/cache 中有一个凭证缓存,它允许我缓存凭证一段时间。这在使用 MFA 时非常有用。 boto3 是否具有类似的功能,或者我是否必须显式缓存从 session = boto3.session.Session(profile_name='CTO:Admin') 返回的凭据? ?

最佳答案

它已经在那里了。

http://boto3.readthedocs.org/en/latest/guide/configuration.html#assume-role-provider

When you specify a profile that has IAM role configuration, boto3 will make an AssumeRole call to retrieve temporary credentials. Subsequent boto3 API calls will use the cached temporary credentials until they expire, in which case boto3 will automatically refresh credentials. boto3 does not write these temporary credentials to disk. This means that temporary credentials from the AssumeRole calls are only cached in memory within a single Session. All clients created from that session will share the same temporary credentials.

关于amazon-web-services - boto3 是否具有与 awscli 相当的凭证缓存?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35873527/

相关文章:

python - AWS Rekognition 检测标签无效图像编码错误

amazon-web-services - 类型不正确。在 vscode 中编辑时,cloudformation yml 文件中应有 "string"

amazon-web-services - AWS 错误消息 : Requests specifying Server Side Encryption with AWS KMS managed keys require AWS Signature Version 4

java - 无法访问 AWS Tomcat 上的 MySQL 数据库,但可以在本地 Tomcat 上正常工作。 (JDBS 连接错误)

python - 从 Amazon S3 和 Boto3 下载并读取 HDF5 文件

python - 在 Lambda 中读取 AWS S3 CSV 列名

python - boto3 mturk send_bonus 错误

django - 如何在aws elasticbean上安装redis和celery

amazon-web-services - 云形成事件总线策略 : The relative-id "event-bus/bus_name" is invalid for ARN

python - 如何设置生命周期以使用 boto3 删除 s3 存储桶下的文件夹