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

Adds metrics_config to aws_lambda_event_source_mapping #40322

Conversation

amardatar
Copy link
Contributor

Description

This PR adds support for metrics_config in the aws_lambda_event_source_mapping resource. Copied from the related issue:


AWS Lambda announces new Amazon CloudWatch metrics for Lambda Event Source Mappings (ESMs), which provide customers visibility into the processing state of events read by ESMs that subscribe to Amazon SQS, Amazon Kinesis, and Amazon DynamoDB event sources.

Affected Resource(s) and/or Data Source(s)

  • aws_lambda_event_source_mapping

Potential Terraform Configuration

resource "aws_lambda_event_source_mapping" "example" {
  metrics_config {
    metrics = ["EventCount"]
  }
}

Relations

Closes #40275

References

Docs for Event Source Mapping Metrics

API Reference for the EventSourceMappingMetricsConfig

Output from Acceptance Testing

% make testacc TESTS=TestAccLambdaEventSourceMapping_SQS_metricsConfig PKG=lambda
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.3 test ./internal/service/lambda/... -v -count 1 -parallel 20 -run='TestAccLambdaEventSourceMapping_SQS_metricsConfig'  -timeout 360m
2024/11/26 23:53:31 Initializing Terraform AWS Provider...
=== RUN   TestAccLambdaEventSourceMapping_SQS_metricsConfig
=== PAUSE TestAccLambdaEventSourceMapping_SQS_metricsConfig
=== CONT  TestAccLambdaEventSourceMapping_SQS_metricsConfig
--- PASS: TestAccLambdaEventSourceMapping_SQS_metricsConfig (96.66s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/lambda     101.640s

@amardatar amardatar requested a review from a team as a code owner November 26, 2024 23:57
Copy link

Community Note

Voting for Prioritization

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

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/lambda Issues and PRs that pertain to the lambda service. needs-triage Waiting for first response or review from a maintainer. labels Nov 26, 2024
@amardatar
Copy link
Contributor Author

Created a PR for this as it looked straight-forward enough, and something I'm looking to use. That said - I'm new to Go and to this project so please call out if I should be changing anything in here or am not following standards.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome @amardatar 👋

It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTOR guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.

Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.

Thanks again, and welcome to the community! 😃

@ewbankkit ewbankkit added enhancement Requests to existing resources that expand the functionality or scope. and removed needs-triage Waiting for first response or review from a maintainer. labels Nov 27, 2024
@ewbankkit ewbankkit self-assigned this Nov 27, 2024
@github-actions github-actions bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Nov 27, 2024
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_basic\|TestAccLambdaEventSourceMapping_SQS_metricsConfig' PKG=lambda
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.3 test ./internal/service/lambda/... -v -count 1 -parallel 20  -run=TestAccLambdaEventSourceMapping_Kinesis_basic\|TestAccLambdaEventSourceMapping_SQS_metricsConfig -timeout 360m
2024/11/27 09:08:57 Initializing Terraform AWS Provider...
=== RUN   TestAccLambdaEventSourceMapping_Kinesis_basic
=== PAUSE TestAccLambdaEventSourceMapping_Kinesis_basic
=== RUN   TestAccLambdaEventSourceMapping_SQS_metricsConfig
=== PAUSE TestAccLambdaEventSourceMapping_SQS_metricsConfig
=== CONT  TestAccLambdaEventSourceMapping_Kinesis_basic
=== CONT  TestAccLambdaEventSourceMapping_SQS_metricsConfig
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_basic (67.84s)
--- PASS: TestAccLambdaEventSourceMapping_SQS_metricsConfig (97.77s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/lambda	103.267s

Copy link
Contributor

@johnsonaj johnsonaj 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_basic\|TestAccLambdaEventSourceMapping_SQS_metricsConfig' PKG=lambda

make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.3 test ./internal/service/lambda/... -v -count 1 -parallel 20  -run=TestAccLambdaEventSourceMapping_Kinesis_basic\|TestAccLambdaEventSourceMapping_SQS_metricsConfig -timeout 360m
2024/11/27 10:32:29 Initializing Terraform AWS Provider...
=== RUN   TestAccLambdaEventSourceMapping_Kinesis_basic
=== PAUSE TestAccLambdaEventSourceMapping_Kinesis_basic
=== RUN   TestAccLambdaEventSourceMapping_SQS_metricsConfig
=== PAUSE TestAccLambdaEventSourceMapping_SQS_metricsConfig
=== CONT  TestAccLambdaEventSourceMapping_Kinesis_basic
=== CONT  TestAccLambdaEventSourceMapping_SQS_metricsConfig
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_basic (75.07s)
--- PASS: TestAccLambdaEventSourceMapping_SQS_metricsConfig (109.78s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/lambda	116.254s

@ewbankkit ewbankkit merged commit 398878c into hashicorp:main Nov 27, 2024
42 checks passed
@github-actions github-actions bot added this to the v5.79.0 milestone Nov 27, 2024
@amardatar amardatar deleted the f-aws_lambda_event_source_mapping-metrics_config branch November 27, 2024 16:42
@ewbankkit
Copy link
Contributor

@amardatar Thanks for the contribution 🎉 👏.

@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Dec 3, 2024
Copy link

github-actions bot commented Dec 3, 2024

This functionality has been released in v5.79.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!

Copy link

github-actions bot commented Jan 3, 2025

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 Jan 3, 2025
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. enhancement Requests to existing resources that expand the functionality or scope. service/lambda Issues and PRs that pertain to the lambda service. 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.

CloudWatch metrics for Lambda Event Source Mappings
3 participants