Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
Terraform Version
Terraform v0.12.21
Affected Resource(s)
- aws_lambda_event_source_mapping
Terraform Configuration Files
resource "aws_lambda_event_source_mapping" "kinesis" {
count = var.kinesis_trigger != null && var.enabled ? 1 : 0
event_source_arn = var.kinesis_trigger.event_source_arn
function_name = aws_lambda_function.lambda.function_name
starting_position = var.kinesis_trigger.starting_position
batch_size = var.kinesis_trigger.batch_size
parallelization_factor = var.kinesis_trigger.parallelization_factor
maximum_retry_attempts = var.kinesis_trigger.maximum_retry_attempts
destination_config {
on_failure {
destination_arn = var.kinesis_trigger.destination_arn_on_failure
}
}
}
kinesis_trigger = {
event_source_arn = "arn:aws:kinesis:eu-west-1:XXX:stream/XXX"
starting_position = "LATEST"
batch_size = 100
parallelization_factor = 1
maximum_retry_attempts = 0
destination_arn_on_failure = "arn:aws:sqs:eu-west-1:XXX:XXX"
}
Terraform apply Output
# module.XXX.aws_lambda_event_source_mapping.kinesis[0] will be created
+ resource "aws_lambda_event_source_mapping" "kinesis" {
+ batch_size = 100
+ enabled = true
+ event_source_arn = "arn:aws:kinesis:eu-west-1:XXX:stream/XXX"
+ function_arn = (known after apply)
+ function_name = "XXX"
+ id = (known after apply)
+ last_modified = (known after apply)
+ last_processing_result = (known after apply)
+ maximum_record_age_in_seconds = (known after apply)
+ maximum_retry_attempts = 0
+ parallelization_factor = 1
+ starting_position = "LATEST"
+ state = (known after apply)
+ state_transition_reason = (known after apply)
+ uuid = (known after apply)
+ destination_config {
+ on_failure {
+ destination_arn = "arn:aws:sqs:eu-west-1:XXX:XXX"
}
}
}
module.preprocessor.aws_lambda_event_source_mapping.kinesis[0]: Creation complete after 1s [id=489db491-ae3e-4660-b19e-2560972670f5]
aws lambda list-event-source-mappings Output
"EventSourceMappings": [
{
"UUID": "489db491-ae3e-4660-b19e-2560972670f5",
"BatchSize": 100,
"MaximumBatchingWindowInSeconds": 0,
"ParallelizationFactor": 1,
"EventSourceArn": "arn:aws:kinesis:eu-west-1:XXX:stream/XXX",
"FunctionArn": "arn:aws:lambda:eu-west-1:XXX:function:XXX",
"LastModified": 1584550140.0,
"LastProcessingResult": "No records processed",
"State": "Enabled",
"StateTransitionReason": "User action",
"DestinationConfig": {
"OnFailure": {
"Destination": "arn:aws:sqs:eu-west-1:XXX:XXX"
}
},
"MaximumRecordAgeInSeconds": 604800,
"BisectBatchOnFunctionError": false,
"MaximumRetryAttempts": 10000
},
Expected Behavior
As we can see in terraform apply output, event source mapping with 0 retries should be created.
Actual Behavior
When setting up 0 as a value in terraform for Maximum Retry Attempts, it always creates a mapping with default value 10000 instead of 0. For all other values it works correctly. I also checked result of creating it using AWS CLI and it works correctly for value of "0", so I think there is an bug in provider.
Steps to Reproduce
terraform apply
- 'aws lambda list-event-source-mappings'
Community Note
Terraform Version
Terraform v0.12.21
Affected Resource(s)
Terraform Configuration Files
Terraform apply Output
aws lambda list-event-source-mappings Output
Expected Behavior
As we can see in terraform apply output, event source mapping with 0 retries should be created.
Actual Behavior
When setting up 0 as a value in terraform for Maximum Retry Attempts, it always creates a mapping with default value 10000 instead of 0. For all other values it works correctly. I also checked result of creating it using AWS CLI and it works correctly for value of "0", so I think there is an bug in provider.
Steps to Reproduce
terraform apply