Skip to content

Commit

Permalink
terraform-iam: fix listing for nix-cache-logs and others (hopefully)
Browse files Browse the repository at this point in the history
This adds support for the ListObjects[V2] actions, which should allow
listing the contents in there.
  • Loading branch information
flokli authored and zimbatm committed Nov 11, 2023
1 parent 410a444 commit eccb66d
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions terraform-iam/archeologist.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@ resource "aws_s3_bucket" "archeologist" {

data "aws_iam_policy_document" "archaeologist" {
statement {
sid = "NixCacheInventoryReadOnly"
# Read-only access and listing permissions
# To the cache and releases inventories,
# as well as the bucket where cache bucket logs end up in.
sid = "NixCacheLogsInventoryReadOnly"

actions = [
"s3:List*",
"s3:Get*"
]

Expand All @@ -33,12 +37,15 @@ data "aws_iam_policy_document" "archaeologist" {

resources = [
"arn:aws:s3:::nix-cache-log",
"arn:aws:s3:::nix-cache-log/*"
"arn:aws:s3:::nix-cache-log/*",
"arn:aws:s3:::nix-releases-inventory220231029182031496800000001",
"arn:aws:s3:::nix-releases-inventory220231029182031496800000001/*",
]
}

statement {
sid = "NixArcheologistReadWrite"
# Full access to the Archaeologist bucket
sid = "NixArchaeologistReadWrite"

actions = [
"s3:*"
Expand Down

0 comments on commit eccb66d

Please sign in to comment.