terraform-aws-eventbridge
terraform-aws-eventbridge copied to clipboard
fix: Fix kinesis_target and kinesis_parameters dynamic blocks
Description
Reopened #118 as the issue is still present. Let me know if you don't intend on merging these changes, then I'll stop reopening this one.
Motivation and Context
Target
Before this change the target configuration for kinesis partition seems to be intended to look like this:
kinesis_target = {
partition_key_path = β$.idβ
}
Actually planning with this configuration present will error out though. Reason for this is that the for_each will assign the iterator to just [true] and subsequently try to access a field on it:
β Error: Invalid function argument
β
β on ../../main.tf line 200, in resource "aws_cloudwatch_event_target" "this":
β 200: partition_key_path = lookup(kinesis_target.value, "partition_key_path", null)
β βββββββββββββββββ
β β kinesis_target.value is true
β
β Invalid value for "inputMap" parameter: lookup() requires a map as the first argument.
After this change the configuration looks like this and works as intended (see examples):
partition_key_path = "$.id"
Schedule
Before this change the target configuration for kinesis partition key seems to be intended to look like this:
kinesis_parameters = {
partition_key = βfooβ
}
Actually planning with this configuration present will error out though. Reason for this is the the schedule input would no longer be a valid map due to inconsistent types:
β The given value is not suitable for module.eventbridge.var.schedules declared at ../../variables.tf:177,1-21: attribute types must all match for conversion
β to map.
Additionally even if it passed the for_each will assign the iterator to just [true] and subsequently try to access a field on it --- failing either way.
After this change the configuration looks like this and works as intended (see examples):
partition_key = "foo"
Breaking Changes
No, as the functionality was not working in the first place.
How Has This Been Tested?
- [x] I have updated at least one of the
examples/*to demonstrate and validate my change(s) - [x] I have tested and validated these changes using one or more of the provided
examples/*projects
- [x] I have executed
pre-commit run -aon my pull request
This PR has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this PR will be closed in 10 days
still relevant
This PR is included in version 3.7.1 :tada:
I'm going to lock this pull request because it has been closed for 30 days β³. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.