Skip to content

Commit

Permalink
add a policy change to allow data workspace users to get objects from…
Browse files Browse the repository at this point in the history
… notebooks S3 bucket

add a policy change to allow gitlab runner to put objects into notebooks S3 bucket
  • Loading branch information
sekharpanja committed Nov 12, 2024
1 parent 45b0ba2 commit bda7983
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
11 changes: 11 additions & 0 deletions infra/ecs_main_gitlab.tf
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,17 @@ data "aws_iam_policy_document" "gitlab_runner" {
"${aws_ecr_repository.user_provided.arn}",
]
}

# Allow put object for private packages
statement {
actions = [
"s3:PutObject",
"s3:PutObjectAcl"
]
resources = [
"arn:aws:s3:::${aws_s3_bucket.notebooks.id}/shared/*"
]
}
}

resource "aws_iam_policy_attachment" "gitlab_runner" {
Expand Down
20 changes: 20 additions & 0 deletions infra/s3_notebooks.tf
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,24 @@ data "aws_iam_policy_document" "notebooks" {
]
}
}
statement {
effect = "Allow"
principals {
type = "*"
identifiers = ["*"]
}
actions = [
"s3:GetObject",
]
resources = [
"arn:aws:s3:::${aws_s3_bucket.notebooks.id}/shared/*",
]
condition {
test = "StringEquals"
variable = "aws:SourceVpce"
values = [
aws_vpc_endpoint.s3.id
]
}
}
}

0 comments on commit bda7983

Please sign in to comment.