2017-02-12 85 views
0

我正在將所有我的站點從我的服務器移到s3上。我已經將他們從動態網站轉移到靜態,因此運行服務器不再是運營所必需的。組織需要什麼權限才能通過travisci發佈到s3

最後一個網站是我的博客,它運行jekyll,我寧願不必在本地構建發佈新內容。我不想把它留給github頁面,因爲我不想鎖定到jekyll。

所有這一切說,我試圖將生成過程從我的jenkins服務器移到travis ci上。從文檔中,我認爲我給了該組正確的權限,但我沒有得到它的工作,沒有授予組/用戶"s3:*"

這是我目前的IAM組權限策略:

{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "s3:GetBucketLocation", "s3:ListBucket" ], "Resource": [ "arn:aws:s3:::*" ] }, { "Effect": "Allow", "Action": [ "s3:PutObject", "s3:GetObject", "s3:DeleteObject", "s3:PutObjectVersion", "s3:GetObjectVersion", "s3:DeleteObjectVersion", "s3:ListMultipartUploadParts", "s3:ListMultipartUpload", "s3:RestoreObject", "s3:GetObjectVersionTorrent", "s3:GetObjectTorrent", "s3:PutObjectVersionTagging", "s3:PutObjectTagging", "s3:GetObjectVersionTagging", "s3:GetObjectTagging", "s3:DeleteObjectTagging", "s3:DeleteObjectVersionTagging" ], "Resource": [ "arn:aws:s3:::travis-s3-pub-test/*" ] } ] }

認爲應根據AWS文檔是唯一需要的權限是:

```

  "s3:PutObject", 
      "s3:GetObject", 
      "s3:DeleteObject", 

```

但那並不是我RK。

回答

0

我從系統管理員的幫助下找到了答案,我在哪裏工作,jfronza。

我錯過了acl部分政策。

{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "s3:DeleteObject", "s3:DeleteObjectVersion", "s3:GetObject", "s3:GetObjectAcl", "s3:GetObjectTorrent", "s3:GetObjectVersion", "s3:GetObjectVersionAcl", "s3:GetObjectVersionTorrent", "s3:PutObject", "s3:PutObjectAcl", "s3:PutObjectVersionAcl", "s3:RestoreObject" ], "Resource": [ "arn:aws:s3:::travis-s3-pub-test/", "arn:aws:s3:::travis-s3-pub-test/*" ] }, { "Effect": "Allow", "Action": [ "s3:ListAllMyBuckets" ], "Resource": [ "arn:aws:s3:::*" ] } ] }

ACL部分是文件權限發生,自從被上傳的文件必須是公開的,他們需要這個權限。

雖然Amazon docs on s3 policies在這是非常糟糕的,travisCI docs on working with s3是很好,並告訴我如果我看到他們之前,我發佈了這一點。

相關問題