Created
March 25, 2025 21:31
-
-
Save nivleshc/2f489f405f62dbe4c31e610e6df064f0 to your computer and use it in GitHub Desktop.
This gist contains code from the file lambda.tf which is part of the blog-photo-location-map repository.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_iam_policy" "lambda_policy" { | |
name = "${local.lambda_function_name_prefix}-lambda-policy" | |
policy = <<EOF | |
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": "logs:CreateLogGroup", | |
"Resource": "arn:aws:logs:${local.region}:${local.account_id}:*" | |
}, | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"logs:CreateLogStream", | |
"logs:PutLogEvents" | |
], | |
"Resource": "arn:aws:logs:${local.region}:${local.account_id}:log-group:/aws/lambda/${local.lambda_function_name_prefix}-*:*" | |
}, | |
{ | |
"Sid": "GetPutS3Objects", | |
"Effect": "Allow", | |
"Action": [ | |
"s3:GetObject", | |
"s3:PutObject", | |
"s3:ListBucket" | |
], | |
"Resource": "arn:aws:s3:::${local.website_s3_bucket_name}/*" | |
}, | |
{ | |
"Sid": "ListS3Objects", | |
"Effect": "Allow", | |
"Action": [ | |
"s3:ListBucket" | |
], | |
"Resource": "arn:aws:s3:::${local.website_s3_bucket_name}" | |
} | |
] | |
} | |
EOF | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment