diff --git a/README.md b/README.md index 5051276..8de6915 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Project Banner
-

Latest ReleaseLast UpdatedSlack CommunityGet Support +

Latest ReleaseLast UpdatedSlack Community

@@ -30,8 +30,8 @@ --> -This module deploys an AWS Lambda function from a Zip file or from a Docker image. Additionally, it creates an IAM -role for the Lambda function, which optionally attaches policies to allow for CloudWatch Logs, Cloudwatch Insights, +This module deploys an AWS Lambda function from a Zip file or from a Docker image. Additionally, it creates an IAM +role for the Lambda function, which optionally attaches policies to allow for CloudWatch Logs, Cloudwatch Insights, VPC Access and X-Ray tracing. @@ -86,6 +86,10 @@ module "lambda" { + + + + ## Requirements @@ -147,6 +151,7 @@ module "lambda" { | [enabled](#input\_enabled) | Set to false to prevent the module from creating any resources | `bool` | `null` | no | | [environment](#input\_environment) | ID element. Usually used for region e.g. 'uw2', 'us-west-2', OR role 'prod', 'staging', 'dev', 'UAT' | `string` | `null` | no | | [ephemeral\_storage\_size](#input\_ephemeral\_storage\_size) | The size of the Lambda function Ephemeral storage (/tmp) represented in MB.
The minimum supported ephemeral\_storage value defaults to 512MB and the maximum supported value is 10240MB. | `number` | `null` | no | +| [file\_system\_config](#input\_file\_system\_config) | The Lambda file system configuration block with two required arguments:
- *arn* - The ARN of the EFS file system to mount.
- *local\_mount\_path* - The path where the file system is mounted in the Lambda execution environment. |
object({
arn = string
local_mount_path = string
})
| `null` | no | | [filename](#input\_filename) | The path to the function's deployment package within the local filesystem. If defined, The s3\_-prefixed options and image\_uri cannot be used. | `string` | `null` | no | | [function\_name](#input\_function\_name) | Unique name for the Lambda Function. | `string` | n/a | yes | | [handler](#input\_handler) | The function entrypoint in your code. | `string` | `null` | no | @@ -200,11 +205,6 @@ module "lambda" { - - - - - ## Related Projects Check out these related projects. diff --git a/main.tf b/main.tf index b173da6..1122ecc 100644 --- a/main.tf +++ b/main.tf @@ -89,6 +89,14 @@ resource "aws_lambda_function" "this" { } } + dynamic "file_system_config" { + for_each = var.file_system_config != null ? [var.file_system_config] : [] + content { + arn = file_system_config.value.arn + local_mount_path = file_system_config.value.local_mount_path + } + } + depends_on = [module.cloudwatch_log_group] lifecycle { diff --git a/variables.tf b/variables.tf index c8bfbb0..a7b35ed 100644 --- a/variables.tf +++ b/variables.tf @@ -58,6 +58,19 @@ variable "filename" { default = null } +variable "file_system_config" { + type = object({ + arn = string + local_mount_path = string + }) + description = <