我对aws等人最不熟悉。目前,我想要做的是将一个小war文件上传到s3、bucket、使用s3-bash和PalletOps。为此,我将一个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配置对集群进行配置时,我得到以下错误:
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?#进行模拟,但是即使在带有错误Implicitly denied (no matching statements found).的操作"ListBucket“中也失败了。
我可能是缺少在aws ec2上配置,但不能再往前走了。
发布于 2014-06-04 23:12:46
我认为您可能需要在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"
}
]
}同样值得在“超级用户”预先构建的策略中进行可信测试(如果可以的话),以排除此类权限问题。
https://stackoverflow.com/questions/24046812
复制相似问题