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

r/aws_lambda_event_source_mapping: add filter_criteria attribute #21937

Conversation

roberth-k
Copy link
Contributor

@roberth-k roberth-k commented Nov 28, 2021

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Closes #21921

The AWS SDK commit will be rebased over once that's been merged to main.

Output from acceptance testing:

$ make testacc TESTS=TestAccLambdaEventSourceMapping_Kinesis_ PKG=lambda && make testacc TESTS=TestAccLambdaEventSourceMapping_SQS_ PKG=lambda && make testacc TESTS=TestAccLambdaEventSourceMapping_DynamoDB_ PKG=lambda
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/lambda/... -v -count 1 -parallel 20 -run='TestAccLambdaEventSourceMapping_Kinesis_' -timeout 180m
=== RUN   TestAccLambdaEventSourceMapping_Kinesis_basic
=== PAUSE TestAccLambdaEventSourceMapping_Kinesis_basic
=== RUN   TestAccLambdaEventSourceMapping_Kinesis_startingPositionTimestamp
=== PAUSE TestAccLambdaEventSourceMapping_Kinesis_startingPositionTimestamp
=== RUN   TestAccLambdaEventSourceMapping_Kinesis_batchWindow
=== PAUSE TestAccLambdaEventSourceMapping_Kinesis_batchWindow
=== RUN   TestAccLambdaEventSourceMapping_Kinesis_parallelizationFactor
=== PAUSE TestAccLambdaEventSourceMapping_Kinesis_parallelizationFactor
=== RUN   TestAccLambdaEventSourceMapping_Kinesis_tumblingWindowInSeconds
=== PAUSE TestAccLambdaEventSourceMapping_Kinesis_tumblingWindowInSeconds
=== RUN   TestAccLambdaEventSourceMapping_Kinesis_maximumRetryAttempts
=== PAUSE TestAccLambdaEventSourceMapping_Kinesis_maximumRetryAttempts
=== RUN   TestAccLambdaEventSourceMapping_Kinesis_maximumRetryAttemptsZero
=== PAUSE TestAccLambdaEventSourceMapping_Kinesis_maximumRetryAttemptsZero
=== RUN   TestAccLambdaEventSourceMapping_Kinesis_maximumRetryAttemptsNegativeOne
=== PAUSE TestAccLambdaEventSourceMapping_Kinesis_maximumRetryAttemptsNegativeOne
=== RUN   TestAccLambdaEventSourceMapping_Kinesis_maximumRecordAgeInSeconds
=== PAUSE TestAccLambdaEventSourceMapping_Kinesis_maximumRecordAgeInSeconds
=== RUN   TestAccLambdaEventSourceMapping_Kinesis_maximumRecordAgeInSecondsNegativeOne
=== PAUSE TestAccLambdaEventSourceMapping_Kinesis_maximumRecordAgeInSecondsNegativeOne
=== RUN   TestAccLambdaEventSourceMapping_Kinesis_bisectBatch
=== PAUSE TestAccLambdaEventSourceMapping_Kinesis_bisectBatch
=== RUN   TestAccLambdaEventSourceMapping_Kinesis_destination
=== PAUSE TestAccLambdaEventSourceMapping_Kinesis_destination
=== CONT  TestAccLambdaEventSourceMapping_Kinesis_basic
=== CONT  TestAccLambdaEventSourceMapping_Kinesis_maximumRetryAttemptsZero
=== CONT  TestAccLambdaEventSourceMapping_Kinesis_destination
=== CONT  TestAccLambdaEventSourceMapping_Kinesis_maximumRetryAttempts
=== CONT  TestAccLambdaEventSourceMapping_Kinesis_bisectBatch
=== CONT  TestAccLambdaEventSourceMapping_Kinesis_maximumRecordAgeInSecondsNegativeOne
=== CONT  TestAccLambdaEventSourceMapping_Kinesis_startingPositionTimestamp
=== CONT  TestAccLambdaEventSourceMapping_Kinesis_parallelizationFactor
=== CONT  TestAccLambdaEventSourceMapping_Kinesis_maximumRecordAgeInSeconds
=== CONT  TestAccLambdaEventSourceMapping_Kinesis_maximumRetryAttemptsNegativeOne
=== CONT  TestAccLambdaEventSourceMapping_Kinesis_tumblingWindowInSeconds
=== CONT  TestAccLambdaEventSourceMapping_Kinesis_batchWindow
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_destination (89.36s)
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_maximumRetryAttempts (94.70s)
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_maximumRecordAgeInSeconds (100.10s)
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_startingPositionTimestamp (102.81s)
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_maximumRetryAttemptsNegativeOne (105.69s)
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_maximumRecordAgeInSecondsNegativeOne (107.56s)
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_bisectBatch (114.26s)
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_maximumRetryAttemptsZero (114.64s)
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_batchWindow (127.67s)
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_parallelizationFactor (141.18s)
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_tumblingWindowInSeconds (147.99s)
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_basic (154.19s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/lambda     156.053s
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/lambda/... -v -count 1 -parallel 20 -run='TestAccLambdaEventSourceMapping_SQS_' -timeout 180m
=== RUN   TestAccLambdaEventSourceMapping_SQS_basic
=== PAUSE TestAccLambdaEventSourceMapping_SQS_basic
=== RUN   TestAccLambdaEventSourceMapping_SQS_batchWindow
=== PAUSE TestAccLambdaEventSourceMapping_SQS_batchWindow
=== RUN   TestAccLambdaEventSourceMapping_SQS_changesInEnabledAreDetected
=== PAUSE TestAccLambdaEventSourceMapping_SQS_changesInEnabledAreDetected
=== RUN   TestAccLambdaEventSourceMapping_SQS_filterCriteria
=== PAUSE TestAccLambdaEventSourceMapping_SQS_filterCriteria
=== CONT  TestAccLambdaEventSourceMapping_SQS_basic
=== CONT  TestAccLambdaEventSourceMapping_SQS_changesInEnabledAreDetected
=== CONT  TestAccLambdaEventSourceMapping_SQS_batchWindow
=== CONT  TestAccLambdaEventSourceMapping_SQS_filterCriteria
--- PASS: TestAccLambdaEventSourceMapping_SQS_batchWindow (58.77s)
--- PASS: TestAccLambdaEventSourceMapping_SQS_changesInEnabledAreDetected (84.46s)
--- PASS: TestAccLambdaEventSourceMapping_SQS_basic (143.37s)
--- PASS: TestAccLambdaEventSourceMapping_SQS_filterCriteria (249.93s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/lambda     251.729s
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/lambda/... -v -count 1 -parallel 20 -run='TestAccLambdaEventSourceMapping_DynamoDB_' -timeout 180m
=== RUN   TestAccLambdaEventSourceMapping_DynamoDB_basic
=== PAUSE TestAccLambdaEventSourceMapping_DynamoDB_basic
=== RUN   TestAccLambdaEventSourceMapping_DynamoDB_functionResponseTypes
=== PAUSE TestAccLambdaEventSourceMapping_DynamoDB_functionResponseTypes
=== CONT  TestAccLambdaEventSourceMapping_DynamoDB_basic
=== CONT  TestAccLambdaEventSourceMapping_DynamoDB_functionResponseTypes
--- PASS: TestAccLambdaEventSourceMapping_DynamoDB_basic (74.16s)
--- PASS: TestAccLambdaEventSourceMapping_DynamoDB_functionResponseTypes (83.07s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/lambda     84.836s

@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. size/XL Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. service/lambda Issues and PRs that pertain to the lambda service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Nov 28, 2021
@github-actions
Copy link

Thank you for your contribution! 🚀

Please note that typically Go dependency changes are handled in this repository by dependabot or the maintainers. This is to prevent pull request merge conflicts and further delay reviews of contributions. Remove any changes to the go.mod or go.sum files and commit them into this pull request.

Additional details:

  • Check open pull requests with the dependencies label to view other dependency updates.
  • If this pull request includes an update the AWS Go SDK (or any other dependency) version, only updates submitted via dependabot will be merged. This pull request will need to remove these changes and will need to be rebased after the existing dependency update via dependabot has been merged for this pull request to be reviewed.
  • If this pull request is for supporting a new AWS service:
    • Ensure the new AWS service changes are following the Contributing Guide section on new services, in particular that the dependency addition and initial provider support are in a separate pull request from other changes (e.g. new resources). Contributions not following this item will not be reviewed until the changes are split.
    • If this pull request is already a separate pull request from the above item, you can ignore this message.

@ewbankkit ewbankkit removed the needs-triage Waiting for first response or review from a maintainer. label Dec 2, 2021
@ewbankkit ewbankkit force-pushed the f-aws_lambda_event_source_mapping-filter_criteria branch from 191c2ec to 2b64999 Compare December 2, 2021 19:35
@github-actions github-actions bot added size/L Managed by automation to categorize the size of a PR. and removed size/XL Managed by automation to categorize the size of a PR. labels Dec 2, 2021
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

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

LGTM 🚀.

% make testacc TESTARGS='-run=TestAccLambdaEventSourceMapping_Kinesis\|TestAccLambdaEventSourceMapping_SQS\|TestAccLambdaEventSourceMapping_DynamoDB' PKG_NAME="internal/service/lambda"
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/lambda/... -v -count 1 -parallel 20 -run=TestAccLambdaEventSourceMapping_Kinesis\|TestAccLambdaEventSourceMapping_SQS\|TestAccLambdaEventSourceMapping_DynamoDB -timeout 180m
=== RUN   TestAccLambdaEventSourceMapping_Kinesis_basic
=== PAUSE TestAccLambdaEventSourceMapping_Kinesis_basic
=== RUN   TestAccLambdaEventSourceMapping_SQS_basic
=== PAUSE TestAccLambdaEventSourceMapping_SQS_basic
=== RUN   TestAccLambdaEventSourceMapping_DynamoDB_basic
=== PAUSE TestAccLambdaEventSourceMapping_DynamoDB_basic
=== RUN   TestAccLambdaEventSourceMapping_DynamoDB_functionResponseTypes
=== PAUSE TestAccLambdaEventSourceMapping_DynamoDB_functionResponseTypes
=== RUN   TestAccLambdaEventSourceMapping_SQS_batchWindow
=== PAUSE TestAccLambdaEventSourceMapping_SQS_batchWindow
=== RUN   TestAccLambdaEventSourceMapping_SQS_changesInEnabledAreDetected
=== PAUSE TestAccLambdaEventSourceMapping_SQS_changesInEnabledAreDetected
=== RUN   TestAccLambdaEventSourceMapping_Kinesis_startingPositionTimestamp
=== PAUSE TestAccLambdaEventSourceMapping_Kinesis_startingPositionTimestamp
=== RUN   TestAccLambdaEventSourceMapping_Kinesis_batchWindow
=== PAUSE TestAccLambdaEventSourceMapping_Kinesis_batchWindow
=== RUN   TestAccLambdaEventSourceMapping_Kinesis_parallelizationFactor
=== PAUSE TestAccLambdaEventSourceMapping_Kinesis_parallelizationFactor
=== RUN   TestAccLambdaEventSourceMapping_Kinesis_tumblingWindowInSeconds
=== PAUSE TestAccLambdaEventSourceMapping_Kinesis_tumblingWindowInSeconds
=== RUN   TestAccLambdaEventSourceMapping_Kinesis_maximumRetryAttempts
=== PAUSE TestAccLambdaEventSourceMapping_Kinesis_maximumRetryAttempts
=== RUN   TestAccLambdaEventSourceMapping_Kinesis_maximumRetryAttemptsZero
=== PAUSE TestAccLambdaEventSourceMapping_Kinesis_maximumRetryAttemptsZero
=== RUN   TestAccLambdaEventSourceMapping_Kinesis_maximumRetryAttemptsNegativeOne
=== PAUSE TestAccLambdaEventSourceMapping_Kinesis_maximumRetryAttemptsNegativeOne
=== RUN   TestAccLambdaEventSourceMapping_Kinesis_maximumRecordAgeInSeconds
=== PAUSE TestAccLambdaEventSourceMapping_Kinesis_maximumRecordAgeInSeconds
=== RUN   TestAccLambdaEventSourceMapping_Kinesis_maximumRecordAgeInSecondsNegativeOne
=== PAUSE TestAccLambdaEventSourceMapping_Kinesis_maximumRecordAgeInSecondsNegativeOne
=== RUN   TestAccLambdaEventSourceMapping_Kinesis_bisectBatch
=== PAUSE TestAccLambdaEventSourceMapping_Kinesis_bisectBatch
=== RUN   TestAccLambdaEventSourceMapping_Kinesis_destination
=== PAUSE TestAccLambdaEventSourceMapping_Kinesis_destination
=== RUN   TestAccLambdaEventSourceMapping_SQS_filterCriteria
=== PAUSE TestAccLambdaEventSourceMapping_SQS_filterCriteria
=== CONT  TestAccLambdaEventSourceMapping_Kinesis_basic
=== CONT  TestAccLambdaEventSourceMapping_Kinesis_maximumRetryAttempts
=== CONT  TestAccLambdaEventSourceMapping_Kinesis_tumblingWindowInSeconds
=== CONT  TestAccLambdaEventSourceMapping_SQS_basic
=== CONT  TestAccLambdaEventSourceMapping_Kinesis_batchWindow
=== CONT  TestAccLambdaEventSourceMapping_Kinesis_bisectBatch
=== CONT  TestAccLambdaEventSourceMapping_SQS_filterCriteria
=== CONT  TestAccLambdaEventSourceMapping_Kinesis_destination
=== CONT  TestAccLambdaEventSourceMapping_DynamoDB_functionResponseTypes
=== CONT  TestAccLambdaEventSourceMapping_SQS_changesInEnabledAreDetected
=== CONT  TestAccLambdaEventSourceMapping_Kinesis_maximumRetryAttemptsNegativeOne
=== CONT  TestAccLambdaEventSourceMapping_SQS_batchWindow
=== CONT  TestAccLambdaEventSourceMapping_Kinesis_maximumRetryAttemptsZero
=== CONT  TestAccLambdaEventSourceMapping_Kinesis_maximumRecordAgeInSeconds
=== CONT  TestAccLambdaEventSourceMapping_DynamoDB_basic
=== CONT  TestAccLambdaEventSourceMapping_Kinesis_maximumRecordAgeInSecondsNegativeOne
=== CONT  TestAccLambdaEventSourceMapping_Kinesis_parallelizationFactor
=== CONT  TestAccLambdaEventSourceMapping_Kinesis_startingPositionTimestamp
--- PASS: TestAccLambdaEventSourceMapping_DynamoDB_basic (83.31s)
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_batchWindow (92.89s)
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_startingPositionTimestamp (103.60s)
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_parallelizationFactor (103.62s)
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_maximumRecordAgeInSeconds (103.84s)
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_maximumRecordAgeInSecondsNegativeOne (112.22s)
--- PASS: TestAccLambdaEventSourceMapping_DynamoDB_functionResponseTypes (122.90s)
--- PASS: TestAccLambdaEventSourceMapping_SQS_changesInEnabledAreDetected (123.48s)
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_tumblingWindowInSeconds (147.70s)
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_maximumRetryAttemptsNegativeOne (154.26s)
--- PASS: TestAccLambdaEventSourceMapping_SQS_batchWindow (157.83s)
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_destination (171.44s)
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_maximumRetryAttemptsZero (176.77s)
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_maximumRetryAttempts (186.27s)
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_bisectBatch (195.89s)
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_basic (199.77s)
--- PASS: TestAccLambdaEventSourceMapping_SQS_basic (207.23s)
--- PASS: TestAccLambdaEventSourceMapping_SQS_filterCriteria (257.96s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/lambda	261.680s

@ewbankkit
Copy link
Contributor

@roberth-k Thanks for the contribution 🎉 👏.
In general, everything looks great.
I changed the filters nested attribute to filter as it represents a repeated block.

@ewbankkit ewbankkit merged commit 8dfef41 into hashicorp:main Dec 2, 2021
@github-actions github-actions bot added this to the v3.69.0 milestone Dec 2, 2021
@github-actions
Copy link

This functionality has been released in v3.69.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@roberth-k roberth-k deleted the f-aws_lambda_event_source_mapping-filter_criteria branch January 16, 2022 20:23
@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 May 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. service/lambda Issues and PRs that pertain to the lambda service. size/L Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

aws_lambda_event_source_mapping: add support for event filtering
2 participants