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

feat: Allow multiple filters in event source mappings #379

Conversation

moritzzimmer
Copy link
Contributor

@moritzzimmer moritzzimmer commented Nov 15, 2022

Description

Enhance configuration of event source mappings to support multiple filters.

Motivation and Context

Fixes #350

Breaking Changes

none

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

@moritzzimmer moritzzimmer changed the title feat: allow multiple filters in event source mappings feat: Allow multiple filters in event source mappings Nov 15, 2022
main.tf Outdated
dynamic "filter" {
for_each = try(each.value.filter_criteria, [])
content {
pattern = try(filter.value.pattern, "")
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
pattern = try(filter.value.pattern, "")
pattern = try(filter.value.pattern, null)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

main.tf Outdated
filter {
pattern = try(each.value["filter_criteria"].pattern, null)
dynamic "filter" {
for_each = try(each.value.filter_criteria, [])
Copy link
Member

Choose a reason for hiding this comment

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

Please add newline after for_each.

Copy link
Member

Choose a reason for hiding this comment

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

There should be a way to make it without introducing a break for existing users.

Please look at this PR where I did a similar change and added support for both types map and list(map) - terraform-aws-modules/terraform-aws-cloudfront#91

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tried to do this supporting both the object and list of object configuration.

Should we use just the new notation in the examples? I kept one using the old notation for testing

@moritzzimmer
Copy link
Contributor Author

@antonbabenko I pushed changes to address your PR feedback. What do you think?

@github-actions
Copy link

github-actions bot commented Jan 8, 2023

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 Jan 8, 2023
@moritzzimmer
Copy link
Contributor Author

Ping

@github-actions github-actions bot removed the stale label Jan 9, 2023
@github-actions
Copy link

github-actions bot commented Feb 9, 2023

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 Feb 9, 2023
@moritzzimmer
Copy link
Contributor Author

@antonbabenko @bryantbiggs any chance we get this done?

@github-actions github-actions bot removed the stale label Feb 10, 2023
@antonbabenko antonbabenko merged commit 66eb330 into terraform-aws-modules:master Feb 10, 2023
antonbabenko pushed a commit that referenced this pull request Feb 10, 2023
## [4.10.0](v4.9.0...v4.10.0) (2023-02-10)

### Features

* Allow multiple filters in event source mappings ([#379](#379)) ([66eb330](66eb330))
@antonbabenko
Copy link
Member

This PR is included in version 4.10.0 🎉

@moritzzimmer moritzzimmer deleted the feat/event_source_filters branch February 13, 2023 08:11
@github-actions
Copy link

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 Mar 16, 2023
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.

Support multiple filters in event source mappings
2 participants