Skip to content
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

fix: Fix kinesis_target and kinesis_parameters dynamic blocks #118

Closed
wants to merge 2 commits into from

Conversation

mschuwalow
Copy link

Description

Reopened #91 as the issue is still present.

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?

  • I have updated at least one of the examples/* to demonstrate and validate my change(s)
  • I have tested and validated these changes using one or more of the provided examples/* projects
  • I have executed pre-commit run -a on my pull request

Copy link

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

@github-actions github-actions bot added the stale label May 13, 2024
Copy link

This PR was automatically closed because of stale in 10 days

@github-actions github-actions bot closed this May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant