-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathiam_role.tf
32 lines (30 loc) · 848 Bytes
/
iam_role.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
28
29
30
31
32
#############################################
# IAM Role
#############################################
resource "aws_iam_role" "lambda_edge_role" {
name = "cloudfront-lambda-edge-role"
description = "For Lambda Edge to put log events at CloudWatch log group"
tags = var.resource_tags
assume_role_policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "",
"Effect": "Allow",
"Principal": {
"Service": [
"lambda.amazonaws.com",
"edgelambda.amazonaws.com"
]
},
"Action": "sts:AssumeRole"
}
]
}
EOF
}
resource "aws_iam_role_policy_attachment" "lambda_edge_role_policy_attachment" {
role = aws_iam_role.lambda_edge_role.name
policy_arn = "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
}