Skip to content

Commit

Permalink
Add enable_kinesis_mapping option (#7)
Browse files Browse the repository at this point in the history
* Add enable_kinesis_mapping option

* Update variables.tf

Co-Authored-By: Torgayev Tamirlan <[email protected]>

* Fix README.md

Co-authored-by: Torgayev Tamirlan <[email protected]>
  • Loading branch information
sekino and prog893 authored Feb 21, 2020
1 parent 0f9ce4a commit a75dc81
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ For more information on module version pinning, see [Selecting a Revision](https
| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| batch_size | Maximum number of records passed for a single Lambda invocation | string | - | yes |
| enable_kinesis_mapping | Determines if the event source mapping will be enabled | string | `true` | no |
| failed_log_s3_bucket | S3 bucket name for saving failed logs (ES API errors etc.) | string | - | yes |
| failed_log_s3_prefix | Path prefix for failed logs | string | - | yes |
| handler | Lambda Function handler (entrypoint) | string | `main.handler` | no |
Expand Down
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ resource "aws_lambda_function" "function" {
resource "aws_lambda_event_source_mapping" "kinesis_mapping" {
batch_size = var.batch_size
event_source_arn = data.aws_kinesis_stream.source.arn
enabled = true
enabled = var.enable_kinesis_mapping
function_name = aws_lambda_function.function.arn
starting_position = var.starting_position
}
Expand Down
6 changes: 5 additions & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ variable "batch_size" {
description = "Maximum number of records passed for a single Lambda invocation"
}

variable "enable_kinesis_mapping" {
description = "Determines if the event source mapping will be enabled"
default = true
}

variable "lambda_package_url" {
description = "Lambda package URL (see Usage in README)"
}
Expand Down Expand Up @@ -97,4 +102,3 @@ variable "log_retention_in_days" {
description = "Lambda Function log retention in days"
default = 30
}

0 comments on commit a75dc81

Please sign in to comment.