bash - aws-cli create-invalidation 给出签名过期错误
问题描述
我的脚本涉及将文件上传到 s3,然后创建一个失效来刷新内容。
上传到 s3 部分工作正常,但是在创建失效时,我收到了这个错误:
An error occurred (SignatureDoesNotMatch) when calling the CreateInvalidation
operation: Signature expired: 20190717T012747Z is now earlier than
20190717T012755Z (20190717T013255Z - 5 min.)
但是 s3 操作有效,所以对我来说为什么云端不起作用是一个难题。
我的脚本是这样的:
# deploy to the s3 bucket
aws s3 sync ./public/. s3://{bucket} --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers
# invalidate CF
aws cloudfront create-invalidation --distribution-id {dist_id} --paths /*
我的 IAM 权限设置为CloudFrontFullAccess
,即:
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"s3:ListAllMyBuckets"
],
"Effect": "Allow",
"Resource": "arn:aws:s3:::*"
},
{
"Action": [
"acm:ListCertificates",
"cloudfront:*",
"iam:ListServerCertificates",
"waf:ListWebACLs",
"waf:GetWebACL"
],
"Effect": "Allow",
"Resource": "*"
}
]
}
解决方案
推荐阅读
- libgdx - 毛衣效果着色器 Libgdx
- java - gradle 5 - windows java.io.IOException: CreateProcess 错误=206,文件名太长
- swift - 待办事项列表 - 显示项目计数的“正确细节”单元格样式
- batch-file - 通过批处理文件创建没有重复的元素集合
- android - 如何以编程方式在android中打开谷歌播放保护?
- visual-studio - vs c++ 错误列表 Lnk1104 .obj 带有奇怪的文件路径
- git - Git:即使在新克隆上也会出现“损坏的松散对象”
- javascript - 如何在反应状态挂钩上使用地图功能
- android - 如何获取 Clarifai 的 Android SDK?
- sql - (PL/SQL) 创建新数据库时崩溃