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: Fixed event source mapping filter criteria #272

Merged
merged 1 commit into from
Feb 23, 2022

Conversation

sindrig
Copy link
Contributor

@sindrig sindrig commented Feb 23, 2022

This closes #271

Description

See #271

How Has This Been Tested?

  • I have tested and validated these changes using one or more of the provided examples/* projects

@sindrig sindrig changed the title Fix event source mapping filter criteria fix: event source mapping filter criteria Feb 23, 2022
@@ -262,7 +262,7 @@ resource "aws_lambda_event_source_mapping" "this" {

content {
filter {
pattern = lookup(filter_criteria, "pattern", null)
pattern = lookup(each.value["filter_criteria"], "pattern", null)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think instead we should change line 261 to

for_each = try(each.value.filter_criteria, [])

which should make 265 work as intended without changes (I think, haven't tried myself yet)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bryantbiggs This module is still full of lookup() expressions, so using try() is not so critical here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to follow what's done elsewhere in this module. I can change it if you want though.

@antonbabenko antonbabenko changed the title fix: event source mapping filter criteria fix: Fixed event source mapping filter criteria Feb 23, 2022
@antonbabenko antonbabenko merged commit a5c03fe into terraform-aws-modules:master Feb 23, 2022
@antonbabenko
Copy link
Member

Thanks @sindrig !

antonbabenko pushed a commit that referenced this pull request Feb 23, 2022
### [2.34.1](v2.34.0...v2.34.1) (2022-02-23)

### Bug Fixes

* Fixed event source mapping filter criteria ([#272](#272)) ([a5c03fe](a5c03fe))
@antonbabenko
Copy link
Member

This PR is included in version 2.34.1 🎉

@github-actions
Copy link

github-actions bot commented Nov 8, 2022

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Event source filter criteria does not work
3 participants