Skip to content

Commit fe55a5e

Browse files
committed
⚡ json encode
1 parent 3c517aa commit fe55a5e

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

main.tf

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,20 @@
22
# IAM #
33
###############
44
resource "aws_iam_role" "iam_for_lambda" {
5-
name = "${var.function_name}-role"
6-
assume_role_policy = <<EOF
7-
{
8-
"Version": "2012-10-17",
9-
"Statement": [
10-
{
11-
"Action": "sts:AssumeRole",
12-
"Principal": {
13-
"Service": "lambda.amazonaws.com"
14-
},
15-
"Effect": "Allow",
16-
"Sid": ""
17-
}
18-
]
19-
}
20-
EOF
5+
name = "${var.function_name}-role"
6+
assume_role_policy = jsonencode({
7+
Version = "2012-10-17"
8+
Statement = [
9+
{
10+
Sid = "AllowFromLambda",
11+
Effect = "Allow"
12+
Action = "sts.AssumeRole"
13+
Principal = {
14+
Service = "lambda.amazonaws.com"
15+
}
16+
}
17+
]
18+
})
2119
}
2220

2321
# IAM policy for logging from a lambda

0 commit comments

Comments
 (0)