diff --git a/README.md b/README.md index 3950e29..a52a81c 100644 --- a/README.md +++ b/README.md @@ -10,9 +10,8 @@ --> -[enter-at][website] - -# terraform-aws-lambda [![Build Status](https://github.com/enter-at/terraform-aws-lambda/workflows/Terraform%20Lint/badge.svg)](https://github.com/enter-at/terraform-aws-lambda/actions) [![Latest Release](https://img.shields.io/github/release/enter-at/terraform-aws-lambda.svg)](https://github.com/enter-at/terraform-aws-lambda/releases/latest) [![Semantic Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) +# terraform-aws-lambda + [![Build Status](https://github.com/enter-at/terraform-aws-lambda/workflows/Terraform%20Lint/badge.svg)](https://github.com/enter-at/terraform-aws-lambda/actions) [![Latest Release](https://img.shields.io/github/release/enter-at/terraform-aws-lambda.svg)](https://github.com/enter-at/terraform-aws-lambda/releases/latest) [![Semantic Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) Terraform module designed to facilitate the creation of AWS Lambda functions. @@ -27,10 +26,12 @@ It's 100% Open Source and licensed under the [APACHE2](LICENSE). + + ## Usage -**IMPORTANT:** The `master` branch is used in `source` just as an example. In your code, do not pin to `master` because there may be breaking changes between releases. +**IMPORTANT:** The `main` branch is used in `source` just as an example. In your code, do not pin to `main` because there may be breaking changes between releases. Instead pin to the release tag (e.g. `?ref=tags/x.y.z`) of one of our [latest releases](https://github.com/enter-at/terraform-aws-lambda/releases). @@ -38,7 +39,7 @@ Instead pin to the release tag (e.g. `?ref=tags/x.y.z`) of one of our [latest re ```hcl module "lambda" { - source = "git::https://github.com/enter-at/terraform-aws-lambda.git?ref=master" + source = "git::https://github.com/enter-at/terraform-aws-lambda.git?ref=main" function_name = "test-service" handler = "service/handler" source_dir = var.source_dir @@ -57,7 +58,7 @@ locals { } module "lambda" { - source = "git::https://github.com/enter-at/terraform-aws-lambda.git?ref=master" + source = "git::https://github.com/enter-at/terraform-aws-lambda.git?ref=main" function_name = "test-service" handler = "${local.service_dir}/handler" source_dir = var.source_dir @@ -112,44 +113,62 @@ resource "aws_lambda_alias" "production" { + +## Requirements + +| Name | Version | +|------|---------| +| terraform | ~> 0.13 | + +## Providers + +| Name | Version | +|------|---------| +| archive | n/a | +| aws | n/a | +| null | n/a | +| random | n/a | + ## Inputs | Name | Description | Type | Default | Required | -|------|-------------|:----:|:-----:|:-----:| -| cloudwatch_log_subscription_filter | (Optional) A list of CloudWatch Logs subscription filter. | object | `null` | no | -| dead_letter_config | (Optional) Nested block to configure the function's dead letter queue. | object | `null` | no | -| description | (Optional) Description of what the Lambda function does. | string | `null` | no | -| environment | (Optional) The Lambda environment's configuration settings. | object | `null` | no | -| force_detach_policies | (Optional) Specifies to force detaching any policies the role has before destroying it. Defaults to false. | bool | `false` | no | -| function_name | (Required) A unique name for the Lambda function. | string | - | yes | -| handler | (Required) The function entrypoint in your code. | string | - | yes | -| layers | (Optional) List of Lambda Layer Version ARNs (maximum of 5) to attach to the Lambda function. | list(string) | `null` | no | -| memory_size | (Optional) Amount of memory in MB the Lambda function can use at runtime. Defaults to 128. | number | `128` | no | -| module_name | (Optional) The location of the handler source code module. Defaults to '.' | string | `.` | no | -| policy | (Optional) An additional policy to attach to the Lambda function role. | object | `null` | no | -| provisioned_concurrency_config | (Optional) Lambda Provisioned Concurrency Configuration. | object | `null` | no | -| publish | (Optional) Whether to publish creation/change as new Lambda function version. Defaults to false. | bool | `false` | no | -| reserved_concurrent_executions | (Optional) The amount of reserved concurrent executions for this Lambda function. | number | `null` | no | -| rsync_pattern | (Optional) A list of rsync pattern to include or exclude files and directories. | list(string) | `` | no | -| runtime | (Required) The identifier of the function's runtime. | string | - | yes | -| source_dir | (Required) The location of the handler source code. | string | - | yes | -| tags | (Optional) A mapping of tags to assign to the object. | map(string) | `null` | no | -| timeout | (Optional) The amount of time the Lambda function has to run in seconds. Defaults to 3. | number | `3` | no | -| tracing_config | (Optional) A child block with a single argument mode | object | `null` | no | -| vpc_config | (Optional) Provide this to allow your function to access the VPC. | object | `null` | no | +|------|-------------|------|---------|:--------:| +| cloudwatch\_log\_subscription\_filter | (Optional) A list of CloudWatch Logs subscription filter. |
list(object({
name = string
filter_pattern = string
destination_arn = string
}))
| `null` | no | +| cloudwatch\_retention\_in\_days | (Optional) Specifies the number of days you want to retain log events in the specified log group. | `any` | `null` | no | +| dead\_letter\_config | (Optional) Nested block to configure the function's dead letter queue. |
object({
target_arn = string
})
| `null` | no | +| description | (Optional) Description of what the Lambda function does. | `string` | `null` | no | +| environment | (Optional) The Lambda environment's configuration settings. |
object({
variables = map(string)
})
| `null` | no | +| force\_detach\_policies | (Optional) Specifies to force detaching any policies the role has before destroying it. Defaults to false. | `bool` | `false` | no | +| function\_name | (Required) A unique name for the Lambda function. | `string` | n/a | yes | +| handler | (Required) The function entrypoint in your code. | `string` | n/a | yes | +| layers | (Optional) List of Lambda Layer Version ARNs (maximum of 5) to attach to the Lambda function. | `list(string)` | `null` | no | +| memory\_size | (Optional) Amount of memory in MB the Lambda function can use at runtime. Defaults to 128. | `number` | `128` | no | +| module\_name | (Optional) The location of the handler source code module. Defaults to '.' | `string` | `"."` | no | +| policy | (Optional) An additional policy to attach to the Lambda function role. |
object({
json = string
})
| `null` | no | +| provisioned\_concurrency\_config | (Optional) Lambda Provisioned Concurrency Configuration. |
object({
provisioned_concurrent_executions = number
qualifier = string
})
| `null` | no | +| publish | (Optional) Whether to publish creation/change as new Lambda function version. Defaults to false. | `bool` | `false` | no | +| reserved\_concurrent\_executions | (Optional) The amount of reserved concurrent executions for this Lambda function. | `number` | `null` | no | +| rsync\_pattern | (Optional) A list of rsync pattern to include or exclude files and directories. | `list(string)` |
[
"--include=*"
]
| no | +| runtime | (Required) The identifier of the function's runtime. | `string` | n/a | yes | +| source\_dir | (Required) The location of the handler source code. | `string` | n/a | yes | +| tags | (Optional) A mapping of tags to assign to the object. | `map(string)` | `null` | no | +| timeout | (Optional) The amount of time the Lambda function has to run in seconds. Defaults to 3. | `number` | `3` | no | +| tracing\_config | (Optional) A child block with a single argument mode |
object({
mode = string
})
| `null` | no | +| vpc\_config | (Optional) Provide this to allow your function to access the VPC. |
object({
security_group_ids = list(string)
subnet_ids = list(string)
})
| `null` | no | ## Outputs | Name | Description | |------|-------------| | arn | The Amazon Resource Name (ARN) identifying the Lambda function. | -| function_name | The name identifying the Lambda function. | -| function_timeout | The amount of time the Lambda function can run in seconds. | -| function_version | The latest published version of the Lambda function. | -| invoke_arn | The ARN to be used for invoking the Lambda function | -| role_arn | The ARN of the IAM role created for the Lambda function | -| role_name | The name of the IAM role created for the Lambda function | +| function\_name | The name identifying the Lambda function. | +| function\_timeout | The amount of time the Lambda function can run in seconds. | +| function\_version | The latest published version of the Lambda function. | +| invoke\_arn | The ARN to be used for invoking the Lambda function | +| role\_arn | The ARN of the IAM role created for the Lambda function | +| role\_name | The name of the IAM role created for the Lambda function | + @@ -223,16 +242,3 @@ See [LICENSE](LICENSE) for full details. - -### Contributors - - -[![Steffen Leistner][sleistner_avatar]][sleistner_homepage] - - - [sleistner_homepage]: https://github.com/sleistner - [sleistner_avatar]: https://res.cloudinary.com/enter-at/image/fetch/f_png,r_max,w_100,h_100,c_thumb/https://github.com/sleistner.png - - - - [website]: https://github.com/enter-at diff --git a/docs/terraform.md b/docs/terraform.md index 3cbb3ae..e04f6b2 100644 --- a/docs/terraform.md +++ b/docs/terraform.md @@ -1,38 +1,56 @@ + +## Requirements + +| Name | Version | +|------|---------| +| terraform | ~> 0.13 | + +## Providers + +| Name | Version | +|------|---------| +| archive | n/a | +| aws | n/a | +| null | n/a | +| random | n/a | + ## Inputs | Name | Description | Type | Default | Required | -|------|-------------|:----:|:-----:|:-----:| -| cloudwatch_log_subscription_filter | (Optional) A list of CloudWatch Logs subscription filter. | object | `null` | no | -| dead_letter_config | (Optional) Nested block to configure the function's dead letter queue. | object | `null` | no | -| description | (Optional) Description of what the Lambda function does. | string | `null` | no | -| environment | (Optional) The Lambda environment's configuration settings. | object | `null` | no | -| force_detach_policies | (Optional) Specifies to force detaching any policies the role has before destroying it. Defaults to false. | bool | `false` | no | -| function_name | (Required) A unique name for the Lambda function. | string | - | yes | -| handler | (Required) The function entrypoint in your code. | string | - | yes | -| layers | (Optional) List of Lambda Layer Version ARNs (maximum of 5) to attach to the Lambda function. | list(string) | `null` | no | -| memory_size | (Optional) Amount of memory in MB the Lambda function can use at runtime. Defaults to 128. | number | `128` | no | -| module_name | (Optional) The location of the handler source code module. Defaults to '.' | string | `.` | no | -| policy | (Optional) An additional policy to attach to the Lambda function role. | object | `null` | no | -| provisioned_concurrency_config | (Optional) Lambda Provisioned Concurrency Configuration. | object | `null` | no | -| publish | (Optional) Whether to publish creation/change as new Lambda function version. Defaults to false. | bool | `false` | no | -| reserved_concurrent_executions | (Optional) The amount of reserved concurrent executions for this Lambda function. | number | `null` | no | -| rsync_pattern | (Optional) A list of rsync pattern to include or exclude files and directories. | list(string) | `` | no | -| runtime | (Required) The identifier of the function's runtime. | string | - | yes | -| source_dir | (Required) The location of the handler source code. | string | - | yes | -| tags | (Optional) A mapping of tags to assign to the object. | map(string) | `null` | no | -| timeout | (Optional) The amount of time the Lambda function has to run in seconds. Defaults to 3. | number | `3` | no | -| tracing_config | (Optional) A child block with a single argument mode | object | `null` | no | -| vpc_config | (Optional) Provide this to allow your function to access the VPC. | object | `null` | no | +|------|-------------|------|---------|:--------:| +| cloudwatch\_log\_subscription\_filter | (Optional) A list of CloudWatch Logs subscription filter. |
list(object({
name = string
filter_pattern = string
destination_arn = string
}))
| `null` | no | +| cloudwatch\_retention\_in\_days | (Optional) Specifies the number of days you want to retain log events in the specified log group. | `any` | `null` | no | +| dead\_letter\_config | (Optional) Nested block to configure the function's dead letter queue. |
object({
target_arn = string
})
| `null` | no | +| description | (Optional) Description of what the Lambda function does. | `string` | `null` | no | +| environment | (Optional) The Lambda environment's configuration settings. |
object({
variables = map(string)
})
| `null` | no | +| force\_detach\_policies | (Optional) Specifies to force detaching any policies the role has before destroying it. Defaults to false. | `bool` | `false` | no | +| function\_name | (Required) A unique name for the Lambda function. | `string` | n/a | yes | +| handler | (Required) The function entrypoint in your code. | `string` | n/a | yes | +| layers | (Optional) List of Lambda Layer Version ARNs (maximum of 5) to attach to the Lambda function. | `list(string)` | `null` | no | +| memory\_size | (Optional) Amount of memory in MB the Lambda function can use at runtime. Defaults to 128. | `number` | `128` | no | +| module\_name | (Optional) The location of the handler source code module. Defaults to '.' | `string` | `"."` | no | +| policy | (Optional) An additional policy to attach to the Lambda function role. |
object({
json = string
})
| `null` | no | +| provisioned\_concurrency\_config | (Optional) Lambda Provisioned Concurrency Configuration. |
object({
provisioned_concurrent_executions = number
qualifier = string
})
| `null` | no | +| publish | (Optional) Whether to publish creation/change as new Lambda function version. Defaults to false. | `bool` | `false` | no | +| reserved\_concurrent\_executions | (Optional) The amount of reserved concurrent executions for this Lambda function. | `number` | `null` | no | +| rsync\_pattern | (Optional) A list of rsync pattern to include or exclude files and directories. | `list(string)` |
[
"--include=*"
]
| no | +| runtime | (Required) The identifier of the function's runtime. | `string` | n/a | yes | +| source\_dir | (Required) The location of the handler source code. | `string` | n/a | yes | +| tags | (Optional) A mapping of tags to assign to the object. | `map(string)` | `null` | no | +| timeout | (Optional) The amount of time the Lambda function has to run in seconds. Defaults to 3. | `number` | `3` | no | +| tracing\_config | (Optional) A child block with a single argument mode |
object({
mode = string
})
| `null` | no | +| vpc\_config | (Optional) Provide this to allow your function to access the VPC. |
object({
security_group_ids = list(string)
subnet_ids = list(string)
})
| `null` | no | ## Outputs | Name | Description | |------|-------------| | arn | The Amazon Resource Name (ARN) identifying the Lambda function. | -| function_name | The name identifying the Lambda function. | -| function_timeout | The amount of time the Lambda function can run in seconds. | -| function_version | The latest published version of the Lambda function. | -| invoke_arn | The ARN to be used for invoking the Lambda function | -| role_arn | The ARN of the IAM role created for the Lambda function | -| role_name | The name of the IAM role created for the Lambda function | +| function\_name | The name identifying the Lambda function. | +| function\_timeout | The amount of time the Lambda function can run in seconds. | +| function\_version | The latest published version of the Lambda function. | +| invoke\_arn | The ARN to be used for invoking the Lambda function | +| role\_arn | The ARN of the IAM role created for the Lambda function | +| role\_name | The name of the IAM role created for the Lambda function | +