Skip to content

Commit df325ba

Browse files
committed
Additional trust relashionships
See: claranet#59
1 parent df0a7ce commit df325ba

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ Inputs for this module are the same as the [aws_lambda_function](https://www.ter
6767
| build\_script | The path to the script which will compile a zip of the lambda function | string | `"build.py"` | no |
6868
| cloudwatch\_logs | Set this to false to disable logging your Lambda output to CloudWatch Logs | bool | true | no |
6969
| policy | An additional policy to attach to the Lambda function role | object({json=string}) | | no |
70+
| trusted\_entities | Additional trusted entities for the Lambda function. The lambda.amazonaws.com (and edgelambda.amazonaws.com if lambda\_at\_edge is true) is always set | `list(string)` | | no |
7071

7172
The following arguments from the [aws_lambda_function](https://www.terraform.io/docs/providers/aws/r/lambda_function.html) resource are not supported:
7273

iam.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ data "aws_iam_policy_document" "assume_role" {
77

88
principals {
99
type = "Service"
10-
identifiers = ["lambda.amazonaws.com"]
10+
identifiers = concat(list("lambda.amazonaws.com"), var.trusted_entities)
1111
}
1212
}
1313
}

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,9 @@ variable "cloudwatch_logs" {
108108
type = bool
109109
default = true
110110
}
111+
112+
variable "trusted_entities" {
113+
description = "Lambda function additional trusted entities for assuming roles (trust relationship)"
114+
type = list(string)
115+
default = []
116+
}

0 commit comments

Comments
 (0)