File tree Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,9 @@ module "lambda" {
3232 source_path = " ${path.module}/lambda.py"
3333
3434 // Attach a policy.
35- policy = data .aws_iam_policy_document .lambda .json
35+ policy = {
36+ json = data .aws_iam_policy_document .lambda .json
37+ }
3638
3739 // Add a dead letter queue.
3840 dead_letter_config {
@@ -64,7 +66,7 @@ Inputs for this module are the same as the [aws_lambda_function](https://www.ter
6466| ** source\_ path** | The absolute path to a local file or directory containing your Lambda source code | string | | yes |
6567| build\_ script | The path to the script which will compile a zip of the lambda function | string | ` "build.py" ` | no |
6668| cloudwatch\_ logs | Set this to false to disable logging your Lambda output to CloudWatch Logs | bool | true | no |
67- | policy | An addional policy to attach to the Lambda function | string | | no |
69+ | policy | An additional policy to attach to the Lambda function role | object({json= string}) | | no |
6870
6971The following arguments from the [ aws_lambda_function] ( https://www.terraform.io/docs/providers/aws/r/lambda_function.html ) resource are not supported:
7072
Original file line number Diff line number Diff line change @@ -139,7 +139,7 @@ resource "aws_iam_policy" "additional" {
139139 count = var. policy == null ? 0 : 1
140140
141141 name = var. function_name
142- policy = var. policy
142+ policy = var. policy . json
143143}
144144
145145resource "aws_iam_policy_attachment" "additional" {
Original file line number Diff line number Diff line change @@ -96,9 +96,11 @@ variable "tags" {
9696}
9797
9898variable "policy" {
99- description = " An addional policy to attach to the Lambda function"
100- type = string
101- default = null
99+ description = " An additional policy to attach to the Lambda function role"
100+ type = object ({
101+ json = string
102+ })
103+ default = null
102104}
103105
104106variable "cloudwatch_logs" {
You can’t perform that action at this time.
0 commit comments