Skip to content

Commit

Permalink
Added support for reserved_concurrent_executions
Browse files Browse the repository at this point in the history
  • Loading branch information
antonbabenko committed Nov 8, 2019
1 parent af25e58 commit e99fc1c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ If you want to subscribe AWS Lambda Function created by this module to an existi
| kms\_key\_arn | ARN of the KMS key used for decrypting slack webhook url | string | `""` | no |
| lambda\_function\_name | The name of the Lambda function to create | string | `"notify_slack"` | no |
| lambda\_function\_tags | Additional tags for the Lambda function | map(string) | `{}` | no |
| reserved\_concurrent\_executions | The amount of reserved concurrent executions for this lambda function. A value of 0 disables lambda from being triggered and -1 removes any concurrency limitations | number | `"-1"` | no |
| slack\_channel | The name of the channel in Slack for notifications | string | n/a | yes |
| slack\_emoji | A custom emoji that will appear on Slack messages | string | `":aws:"` | no |
| slack\_username | The username that will appear on Slack messages | string | n/a | yes |
Expand Down
13 changes: 7 additions & 6 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,13 @@ resource "aws_lambda_function" "notify_slack" {

function_name = var.lambda_function_name

role = aws_iam_role.lambda[0].arn
handler = "notify_slack.lambda_handler"
source_code_hash = data.archive_file.notify_slack[0].output_base64sha256
runtime = "python3.7"
timeout = 30
kms_key_arn = var.kms_key_arn
role = aws_iam_role.lambda[0].arn
handler = "notify_slack.lambda_handler"
source_code_hash = data.archive_file.notify_slack[0].output_base64sha256
runtime = "python3.7"
timeout = 30
kms_key_arn = var.kms_key_arn
reserved_concurrent_executions = var.reserved_concurrent_executions

environment {
variables = {
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ variable "kms_key_arn" {
default = ""
}

variable "reserved_concurrent_executions" {
description = "The amount of reserved concurrent executions for this lambda function. A value of 0 disables lambda from being triggered and -1 removes any concurrency limitations"
type = number
default = -1
}

variable "tags" {
description = "A map of tags to add to all resources"
type = map(string)
Expand Down

0 comments on commit e99fc1c

Please sign in to comment.