gpt4 book ai didi

amazon-web-services - aws-ec2 - 您无权执行此操作

转载 作者:行者123 更新时间:2023-12-04 19:30:20 26 4
gpt4 key购买 nike

我对 aws 等最不熟悉。我想做的是将一个小的 war 文件上传到 s3 存储桶 using s3-bashPalletOps 目前。为此,我将 clojure 配置文件配置为

(defpallet :default-service
:vmfest
:services {:localhost {:provider "localhost"}
:vmfest {:provider "vmfest"
:vbox-comm :ws
:default-network-type :local
:default-memory-size 1024
:default-local-interface "vboxnet5"}
:aws-ec2 {:provider "aws-ec2"
:identity "AAAAAAAAAAAAAAAAAAQ"
:credential "ATMz1/gerGGFHDh/GFGGFGFGFHFHFHGTUUTUgdgdgdg"}})

在 aws 上,我向该用户添加了 IAM 策略,

{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "iam:*",
"Resource": "*"
}
]
}

在尝试 lein pallet up -P aws-ec2 具有上述 config 的集群时,出现以下错误,

Caused by: org.jclouds.aws.AWSResponseException: request POST
https://ec2.us-east-1.amazonaws.com/ HTTP/1.1 failed with code 403,
error: AWSError{requestId='c20a65f1-64a1-4d7f-be27-690d495ffd09',
requestToken='null', code='UnauthorizedOperation', message='You are not
authorized to perform this operation.', context='{Response=, Errors=}'}
at org.jclouds.aws.handlers.ParseAWSErrorFromXmlContent.handleError(ParseAWSErrorFromXmlContent.java:77)
... 77 more
Subprocess failed

我在 https://policysim.aws.amazon.com/home/index.jsp?# 尝试了模拟也一样,但即使是“ListBucket”操作也失败了,错误为 Implicitly denied (no matching statements found).

我可能是missing to configure on aws ec2但无法进一步移动。

最佳答案

我认为您可能需要在 IAM 策略中加入 s3* 条目:

这是一个只允许上传到特定文件夹的策略示例:

{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"s3:*"
],
"Sid": "Stmt13NNNNNNNN000",
"Resource": [
"arn:aws:s3:::bucket-name/specific-folder/*"
],
"Effect": "Allow"
},
{
"Action": [
"s3:*"
],
"Sid": "StmtNNNNNNNNNNN",
"Resource": [
"arn:aws:s3:::bucket-name"
],
"Effect": "Allow"
}
]
}

还值得使用“高级用户”预建策略(如果可以)中的凭据进行测试,以排除此类权限问题。

关于amazon-web-services - aws-ec2 - 您无权执行此操作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24046812/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com