From f3289a1d75317c01754b37690d5f9adc36ece9b5 Mon Sep 17 00:00:00 2001 From: calve Date: Tue, 9 Jul 2019 16:38:12 +0200 Subject: [PATCH 1/2] Document `attach_policy` Looking at the module behaviour and the code, it's looks like user needs to set `attach_policy` to actually create and attach the additonal `policy`. --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index db25cc2..db89f41 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,7 @@ module "lambda" { source_path = "${path.module}/lambda.py" // Attach a policy. + attach_policy = true policy = { json = data.aws_iam_policy_document.lambda.json } @@ -75,6 +76,8 @@ Inputs for this module are the same as the [aws_lambda_function](https://www.ter | cloudwatch\_logs | Set this to false to disable logging your Lambda output to CloudWatch Logs | `bool` | `true` | no | | lambda\_at\_edge | Set this to true if using Lambda@Edge, to enable publishing, limit the timeout, and allow edgelambda.amazonaws.com to invoke the function | `bool` | `false` | no | | policy | An additional policy to attach to the Lambda function role | `object({json=string})` | | no | +| attach\_policy | Set this to true to attach the additional policy to the Lambda function role | `bool` | `false` | no | + The following arguments from the [aws_lambda_function](https://www.terraform.io/docs/providers/aws/r/lambda_function.html) resource are not supported: From 10dcd3de821f2c708c5c0d510f39249b00478ee1 Mon Sep 17 00:00:00 2001 From: calve Date: Wed, 10 Jul 2019 17:45:14 +0200 Subject: [PATCH 2/2] Refer to the old README for old versions --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index db89f41..bf2fc93 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,8 @@ This Terraform module creates and uploads an AWS Lambda function and hides the u | 1.x.x | 0.12.x | | 0.x.x | 0.11.x | +Refer to the [0.x.x README](https://github.com/claranet/terraform-aws-lambda/blob/v0.12.0/README.md) for Terraform < 0.12 usage. + ## Usage ```js @@ -39,7 +41,6 @@ module "lambda" { source_path = "${path.module}/lambda.py" // Attach a policy. - attach_policy = true policy = { json = data.aws_iam_policy_document.lambda.json } @@ -76,8 +77,6 @@ Inputs for this module are the same as the [aws_lambda_function](https://www.ter | cloudwatch\_logs | Set this to false to disable logging your Lambda output to CloudWatch Logs | `bool` | `true` | no | | lambda\_at\_edge | Set this to true if using Lambda@Edge, to enable publishing, limit the timeout, and allow edgelambda.amazonaws.com to invoke the function | `bool` | `false` | no | | policy | An additional policy to attach to the Lambda function role | `object({json=string})` | | no | -| attach\_policy | Set this to true to attach the additional policy to the Lambda function role | `bool` | `false` | no | - The following arguments from the [aws_lambda_function](https://www.terraform.io/docs/providers/aws/r/lambda_function.html) resource are not supported: