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: Added support for alias to have multiple filter criteria same as function #585

Conversation

aleboarna
Copy link
Contributor

@aleboarna aleboarna commented Jun 17, 2024

… event source mappings, same as lambda function

Description

I have added support in the alias submodule to have multiple event source mapping filter_criteria in line with the main lambda function.

Motivation and Context

I have wasted an entire evening trying to make event source mapping filter_criteria work on the alias with

operation error Lambda: CreateEventSourceMapping, https response error StatusCode: 400, RequestID: 4d25b930-c830-49e2-bbc7-dbd4add503f7, InvalidParameterValueException: Invalid filter pattern definition.

This is based on the example found here

Breaking Changes

Alias will be in line with the existing documentation.

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

@aleboarna aleboarna changed the title feat(alias): added support for alias to have multiple filter criteria… Feat(alias): added support for alias to have multiple filter criteria… Jun 17, 2024
@aleboarna aleboarna changed the title Feat(alias): added support for alias to have multiple filter criteria… Added support for alias to have multiple filter criteria Jun 17, 2024
@aleboarna aleboarna changed the title Added support for alias to have multiple filter criteria fix: Added support for alias to have multiple filter criteria same as function Jun 18, 2024
…event source mappings, same as lambda function
@aleboarna aleboarna force-pushed the feat/alias-multiple-filter-criteria branch from 4fd5f1f to 8ebe70f Compare June 18, 2024 05:13
@aleboarna
Copy link
Contributor Author

Hi @pdecat @antonbabenko,

Could you please review/approve this PR to fix the alias event mapping issue and align it with existing documentation please ?

Comment on lines +170 to +175
dynamic "filter" {
for_each = try(flatten([each.value.filter_criteria]), [])

content {
pattern = try(filter.value.pattern, null)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

@pdecat pdecat left a comment

Choose a reason for hiding this comment

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

LGTM!

@antonbabenko antonbabenko changed the title fix: Added support for alias to have multiple filter criteria same as function feat: Added support for alias to have multiple filter criteria same as function Jun 18, 2024
@antonbabenko antonbabenko merged commit 6549ca1 into terraform-aws-modules:master Jun 18, 2024
31 checks passed
antonbabenko pushed a commit that referenced this pull request Jun 18, 2024
## [7.7.0](v7.6.0...v7.7.0) (2024-06-18)

### Features

* Added support for alias to have multiple filter criteria same as function ([#585](#585)) ([6549ca1](6549ca1))
@antonbabenko
Copy link
Member

This PR is included in version 7.7.0 🎉

@aleboarna
Copy link
Contributor Author

thank you very much! :D

@aleboarna aleboarna deleted the feat/alias-multiple-filter-criteria branch June 18, 2024 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants