Skip to content

Commit

Permalink
feat(syncer): account access control for distribution cache bucket (#585
Browse files Browse the repository at this point in the history
)
  • Loading branch information
rlove authored and npalm committed Mar 9, 2021
1 parent 76c3d9b commit 05c1c11
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions modules/runner-binaries-syncer/runner-binaries-syncer.tf
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,13 @@ resource "aws_s3_bucket_notification" "on_deploy" {
depends_on = [aws_lambda_permission.on_deploy]
}

data "aws_caller_identity" "current" {}

resource "aws_lambda_permission" "on_deploy" {
statement_id = "AllowExecutionFromS3Bucket"
action = "lambda:InvokeFunction"
function_name = aws_lambda_function.syncer.arn
principal = "s3.amazonaws.com"
source_arn = aws_s3_bucket.action_dist.arn
statement_id = "AllowExecutionFromS3Bucket"
action = "lambda:InvokeFunction"
function_name = aws_lambda_function.syncer.arn
principal = "s3.amazonaws.com"
source_account = data.aws_caller_identity.current.account_id
source_arn = aws_s3_bucket.action_dist.arn
}

0 comments on commit 05c1c11

Please sign in to comment.