AWS IAM 角色到期

AWS IAM role expiry

IAM 角色到期时:

Instance roles如EMR中使用的自动更新:

The application is granted the permissions for the actions and resources that you've defined for the role through the security credentials associated with the role. These security credentials are temporary and we rotate them automatically. We make new credentials available at least five minutes before the expiration of the old credentials.

在 AWS SDK 中查找 com.amazonaws.auth.InstanceProfileCredentialsProvider;客户端调用它来获取 IAM 凭证。它生成一个线程 com.amazonaws.auth.EC2CredentialsFetcher,它向提供这些详细信息的特殊 169.x.x.x http 服务器发出 HTTP 请求。每个创建 s3 客户端(或 s3a,在 ASF 构建上)的 spark worker 都将实例化一个 InstanceProfileCredentialsProvider,之后一切都会“正常工作”

IAM 角色过去总是在 1 小时后过期;任何持续 65 分钟以上的工作都会触发刷新。

试试看。