dmn*_*972 1 whitelist amazon-s3 amazon-web-services
我有一个存储桶策略,可将我的 IP 范围列入 AWS 中的白名单。我有一个运行 Packer 构建作业的 EC2 服务器,它尝试从我的存储桶中提取一个对象,但我收到403 Forbidden错误消息,即使运行该作业的 EC2 服务器的 IP 显然在白名单范围内。即使我wget在该CIDR范围内的机器上运行,我也会遇到同样的错误。我很困惑为什么会发生这种情况。政策好像不错。下面是我的存储桶策略、我的服务器的 IP 和错误:
Bucket Policy:
{
"Version": "2012-10-17",
"Id": "S3PolicyId1",
"Statement": [
{
"Sid": "IPAllow",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": [
"arn:aws:s3:::xxxxxxx",
"arn:aws:s3:::xxxxxxx/*"
],
"Condition": {
"IpAddress": {
"aws:SourceIp": [
"10.x.x.x/12"
]
}
}
}
]
}
Run Code Online (Sandbox Code Playgroud)
Server IP:
10.x.x.x/32
Run Code Online (Sandbox Code Playgroud)
Error:
ui,message, amazon-ebs: "msg": "Error downloading
https://s3.amazonaws.com/xxxxx/yyyy.zip to C:\\temp\\xxx.zip Exception
calling \"DownloadFile\" with \"2\" argument(s): \"The remote server
returned an error: (403) Forbidden.\""
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2383 次 |
| 最近记录: |