Skip to content

Automatic Update of README.md #289

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 53 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@

-->

[<img src="https://res.cloudinary.com/enter-at/image/upload/v1576145406/static/logo-svg.svg" alt="enter-at" width="100">][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.
Expand All @@ -27,18 +26,20 @@ 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).


### Simple Example

```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
Expand All @@ -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
Expand Down Expand Up @@ -112,44 +113,62 @@ resource "aws_lambda_alias" "production" {



<!-- markdownlint-disable -->
## 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) | `<list>` | 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. | <pre>list(object({<br> name = string<br> filter_pattern = string<br> destination_arn = string<br> }))</pre> | `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. | <pre>object({<br> target_arn = string<br> })</pre> | `null` | no |
| description | (Optional) Description of what the Lambda function does. | `string` | `null` | no |
| environment | (Optional) The Lambda environment's configuration settings. | <pre>object({<br> variables = map(string)<br> })</pre> | `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. | <pre>object({<br> json = string<br> })</pre> | `null` | no |
| provisioned\_concurrency\_config | (Optional) Lambda Provisioned Concurrency Configuration. | <pre>object({<br> provisioned_concurrent_executions = number<br> qualifier = string<br> })</pre> | `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)` | <pre>[<br> "--include=*"<br>]</pre> | 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 | <pre>object({<br> mode = string<br> })</pre> | `null` | no |
| vpc\_config | (Optional) Provide this to allow your function to access the VPC. | <pre>object({<br> security_group_ids = list(string)<br> subnet_ids = list(string)<br> })</pre> | `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 |

<!-- markdownlint-restore -->



Expand Down Expand Up @@ -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
74 changes: 46 additions & 28 deletions docs/terraform.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,56 @@
<!-- markdownlint-disable -->
## 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) | `<list>` | 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. | <pre>list(object({<br> name = string<br> filter_pattern = string<br> destination_arn = string<br> }))</pre> | `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. | <pre>object({<br> target_arn = string<br> })</pre> | `null` | no |
| description | (Optional) Description of what the Lambda function does. | `string` | `null` | no |
| environment | (Optional) The Lambda environment's configuration settings. | <pre>object({<br> variables = map(string)<br> })</pre> | `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. | <pre>object({<br> json = string<br> })</pre> | `null` | no |
| provisioned\_concurrency\_config | (Optional) Lambda Provisioned Concurrency Configuration. | <pre>object({<br> provisioned_concurrent_executions = number<br> qualifier = string<br> })</pre> | `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)` | <pre>[<br> "--include=*"<br>]</pre> | 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 | <pre>object({<br> mode = string<br> })</pre> | `null` | no |
| vpc\_config | (Optional) Provide this to allow your function to access the VPC. | <pre>object({<br> security_group_ids = list(string)<br> subnet_ids = list(string)<br> })</pre> | `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 |

<!-- markdownlint-restore -->