forked from lfalorni/terraform-aws-lambda-graphql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
iam.tf
27 lines (21 loc) · 731 Bytes
/
iam.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
data "aws_iam_policy" "aws_lambda_vpc_access" {
arn = "arn:aws:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole"
}
data "aws_iam_policy_document" "lambda_logging" {
statement {
sid = "${local.camel_app_name}LambdaLogging${title(var.stage)}"
actions = [
"logs:CreateLogStream",
"logs:PutLogEvents",
]
resources = [
"arn:aws:logs:*:*:/aws/lambda/${var.stage}-${var.app_name}-*",
]
effect = "Allow"
}
}
resource "aws_iam_policy" "lambda_logging" {
description = "Policy to allow the lambda to create and publish logs in cloudwatch"
name = "${var.stage}-${var.app_name}-graphql-lambda-logs"
policy = data.aws_iam_policy_document.lambda_logging.json
}