-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathiam.tf
More file actions
25 lines (24 loc) · 674 Bytes
/
Copy pathiam.tf
File metadata and controls
25 lines (24 loc) · 674 Bytes
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
resource "aws_iam_role" "lambda-role" {
path = "/"
name = "${var.lambda_name}-role"
assume_role_policy = "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"lambda.amazonaws.com\"},\"Action\":\"sts:AssumeRole\"}]}"
max_session_duration = 3600
}
resource "aws_iam_role_policy" "IAMPolicy3" {
policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"cloudwatch:*",
"logs:*"
],
"Resource": "*"
}
]
}
EOF
role = aws_iam_role.lambda-role.name
}