如何在AWS S3复制命令中修复已过期的令牌?
我需要运行命令aws s3 cp< filename> < bucketName>
从EC2 RHEL实例将文件从实例复制到S3存储桶。
当我运行此命令时,我会收到此错误:呼叫PutObject操作时发生错误(已过期的):提供的令牌已过期
我还发现,尝试运行许多其他CLI时,也会发生同样的错误来自实例的命令。
我不想更改我的IAM角色,因为该命令以前工作正常,而IAM政策更改必须经过批准过程。我已经仔细检查了实例假设的IAM角色,并且仍然包含正确的配置,以允许在正确的资源上putobject。
在我的情况下,我该怎么做才能让AWS CLI命令再次工作?
I need to run the command aws s3 cp <filename> <bucketname>
from an EC2 RHEL instance to copy a file from the instance to an S3 bucket.
When I run this command, I receive this error: An error occurred (ExpiredToken) when calling the PutObject operation: The provided token has expired
I also found that this same error occurs when trying to run many other CLI commands from the instance.
I do not want to change my IAM role because the command was previously working perfectly fine and IAM policy changes must go through an approval process. I have double checked the IAM role the instance is assuming and it still contains the correct configuration for allowing PutObject on the correct resources.
What can I do to allow AWS CLI commands to work again in my instance?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
AWS API令牌对时间敏感,云中的VM往往会遭受时钟漂移的影响。
检查RHEL实例的时间准确,并使用 ntp 服务器来确保定期纠正任何漂移。
AWS API tokens are time-sensitive, and VMs in the cloud tend to suffer from clock drift.
Check that time is accurate on the RHEL instance, and use ntp servers to make sure any drift is regularly corrected.