We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3c517aa commit fe55a5eCopy full SHA for fe55a5e
main.tf
@@ -2,22 +2,20 @@
2
# IAM #
3
###############
4
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
+ name = "${var.function_name}-role"
+ assume_role_policy = jsonencode({
+ Version = "2012-10-17"
+ Statement = [
+ {
+ Sid = "AllowFromLambda",
+ Effect = "Allow"
+ Action = "sts.AssumeRole"
+ Principal = {
+ Service = "lambda.amazonaws.com"
+ }
+ ]
+ })
21
}
22
23
# IAM policy for logging from a lambda
0 commit comments