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

aws_lambda_event_source_mapping: Add Kafka config blocks + consumer_group_id #26560

Merged
merged 22 commits into from
Sep 1, 2022

Conversation

A122943
Copy link
Contributor

@A122943 A122943 commented Aug 31, 2022

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 #26559

Output from acceptance testing:

$ make testacc PKG=lambda TESTS=TestAccLambdaEventSourceMapping_selfManagedKafka
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/lambda/... -v -count 1 -parallel 20 -run='TestAccLambdaEventSourceMapping_selfManagedKafka'  -timeout 180m
=== RUN   TestAccLambdaEventSourceMapping_selfManagedKafka
=== PAUSE TestAccLambdaEventSourceMapping_selfManagedKafka
=== CONT  TestAccLambdaEventSourceMapping_selfManagedKafka
--- PASS: TestAccLambdaEventSourceMapping_selfManagedKafka (49.90s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/lambda	53.075s
$ make testacc PKG=lambda TESTS=TestAccLambdaEventSourceMapping_msk
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/lambda/... -v -count 1 -parallel 20 -run='TestAccLambdaEventSourceMapping_msk'  -timeout 180m
=== RUN   TestAccLambdaEventSourceMapping_msk
=== PAUSE TestAccLambdaEventSourceMapping_msk
=== CONT  TestAccLambdaEventSourceMapping_msk
--- PASS: TestAccLambdaEventSourceMapping_msk (3214.43s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/lambda	3217.450s

@github-actions github-actions bot added service/lambda Issues and PRs that pertain to the lambda service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. needs-triage Waiting for first response or review from a maintainer. size/M Managed by automation to categorize the size of a PR. labels Aug 31, 2022
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 @A122943 👋

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! 😃

@A122943 A122943 marked this pull request as ready for review August 31, 2022 13:47
@github-actions github-actions bot added the documentation Introduces or discusses updates to documentation. label Aug 31, 2022
@A122943
Copy link
Contributor Author

A122943 commented Aug 31, 2022

Does anyone know why dependency checks / go mod is failing? I haven't altered any dependencies, and that check wasn't failing last night before I added documentation and a changelog entry today.

@A122943 A122943 changed the title aws_lambda_event_source_mapping: Add self_managed_kafka_config block and consumer_group_id aws_lambda_event_source_mapping: Add kafka config blocks & consumer_group_id Aug 31, 2022
@A122943 A122943 changed the title aws_lambda_event_source_mapping: Add kafka config blocks & consumer_group_id aws_lambda_event_source_mapping: Add kafka config blocks + consumer_group_id Aug 31, 2022
@justinretzolk
Copy link
Member

Hey @A122943 👋 Thank you for your contribution! I believe that the failing check was something on our end. If you rebase, it should clear up the failing check.

@justinretzolk justinretzolk 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 Aug 31, 2022
@A122943
Copy link
Contributor Author

A122943 commented Aug 31, 2022

Hi @justinretzolk! That worked, thank you 😃 I'm happy to answer any questions you or another maintainer might have about these changes.

@A122943 A122943 changed the title aws_lambda_event_source_mapping: Add kafka config blocks + consumer_group_id aws_lambda_event_source_mapping: Add Kafka config blocks + consumer_group_id Aug 31, 2022
ewbankkit and others added 7 commits September 1, 2022 14:39
…fka_event_source_config' and 'self_managed_kafka_event_source_config'.
…ged_kafka_event_source_config' and 'self_managed_kafka_event_source_config'.
…rce_config' Computed.

Acceptance test output:

% make testacc TESTARGS='-run=TestAccLambdaEventSourceMapping_selfManagedKafka' PKG=lambda
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/lambda/... -v -count 1 -parallel 20  -run=TestAccLambdaEventSourceMapping_selfManagedKafka -timeout 180m
=== RUN   TestAccLambdaEventSourceMapping_selfManagedKafka
=== PAUSE TestAccLambdaEventSourceMapping_selfManagedKafka
=== RUN   TestAccLambdaEventSourceMapping_selfManagedKafkaWithEventSourceConfig
=== PAUSE TestAccLambdaEventSourceMapping_selfManagedKafkaWithEventSourceConfig
=== CONT  TestAccLambdaEventSourceMapping_selfManagedKafka
=== CONT  TestAccLambdaEventSourceMapping_selfManagedKafkaWithEventSourceConfig
--- PASS: TestAccLambdaEventSourceMapping_selfManagedKafkaWithEventSourceConfig (53.85s)
--- PASS: TestAccLambdaEventSourceMapping_selfManagedKafka (59.01s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/lambda	62.775s
…ource_config' Computed.

Acceptance test output:

% make testacc TESTARGS='-run=TestAccLambdaEventSourceMapping_msk' PKG=lambda
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/lambda/... -v -count 1 -parallel 20  -run=TestAccLambdaEventSourceMapping_msk -timeout 180m
=== RUN   TestAccLambdaEventSourceMapping_msk
=== PAUSE TestAccLambdaEventSourceMapping_msk
=== RUN   TestAccLambdaEventSourceMapping_mskWithEventSourceConfig
=== PAUSE TestAccLambdaEventSourceMapping_mskWithEventSourceConfig
=== CONT  TestAccLambdaEventSourceMapping_msk
=== CONT  TestAccLambdaEventSourceMapping_mskWithEventSourceConfig
--- PASS: TestAccLambdaEventSourceMapping_mskWithEventSourceConfig (3481.30s)
--- PASS: TestAccLambdaEventSourceMapping_msk (3638.39s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/lambda	3642.258s
@github-actions github-actions bot added size/XL Managed by automation to categorize the size of a PR. and removed size/M Managed by automation to categorize the size of a PR. labels Sep 1, 2022
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_msk' PKG=lambda      
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/lambda/... -v -count 1 -parallel 20  -run=TestAccLambdaEventSourceMapping_msk -timeout 180m
=== RUN   TestAccLambdaEventSourceMapping_msk
=== PAUSE TestAccLambdaEventSourceMapping_msk
=== RUN   TestAccLambdaEventSourceMapping_mskWithEventSourceConfig
=== PAUSE TestAccLambdaEventSourceMapping_mskWithEventSourceConfig
=== CONT  TestAccLambdaEventSourceMapping_msk
=== CONT  TestAccLambdaEventSourceMapping_mskWithEventSourceConfig
--- PASS: TestAccLambdaEventSourceMapping_mskWithEventSourceConfig (3481.30s)
--- PASS: TestAccLambdaEventSourceMapping_msk (3638.39s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/lambda	3642.258s
% make testacc TESTARGS='-run=TestAccLambdaEventSourceMapping_selfManagedKafka' PKG=lambda
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/lambda/... -v -count 1 -parallel 20  -run=TestAccLambdaEventSourceMapping_selfManagedKafka -timeout 180m
=== RUN   TestAccLambdaEventSourceMapping_selfManagedKafka
=== PAUSE TestAccLambdaEventSourceMapping_selfManagedKafka
=== RUN   TestAccLambdaEventSourceMapping_selfManagedKafkaWithEventSourceConfig
=== PAUSE TestAccLambdaEventSourceMapping_selfManagedKafkaWithEventSourceConfig
=== CONT  TestAccLambdaEventSourceMapping_selfManagedKafka
=== CONT  TestAccLambdaEventSourceMapping_selfManagedKafkaWithEventSourceConfig
--- PASS: TestAccLambdaEventSourceMapping_selfManagedKafkaWithEventSourceConfig (53.85s)
--- PASS: TestAccLambdaEventSourceMapping_selfManagedKafka (59.01s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/lambda	62.775s
% make testacc TESTARGS='-run=TestAccLambdaEventSourceMapping_SQS_' PKG=lambda ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/lambda/... -v -count 1 -parallel 3  -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_filterCriteria
--- PASS: TestAccLambdaEventSourceMapping_SQS_changesInEnabledAreDetected (93.91s)
=== CONT  TestAccLambdaEventSourceMapping_SQS_batchWindow
--- PASS: TestAccLambdaEventSourceMapping_SQS_basic (114.10s)
--- PASS: TestAccLambdaEventSourceMapping_SQS_batchWindow (66.82s)
--- PASS: TestAccLambdaEventSourceMapping_SQS_filterCriteria (188.58s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/lambda	192.527s

@ewbankkit
Copy link
Contributor

ewbankkit commented Sep 1, 2022

@A122943 Thanks for the contribution 🎉 👏.
Overall everything was great. I tweaked the new attribute names to match the underling AWS API structure names and made them ForceNew and Computed as they cannot be updated after creation and as you mention in the documentation, if not specified, generated values are returned.

@ewbankkit ewbankkit merged commit 60ec508 into hashicorp:main Sep 1, 2022
@github-actions github-actions bot added this to the v4.29.0 milestone Sep 1, 2022
@A122943
Copy link
Contributor Author

A122943 commented Sep 1, 2022

@A122943 Thanks for the contribution 🎉 👏. Overall everything was great. I tweaked the new attribute names to match the underling AWS API structure names and made them ForceNew and Computed as they cannot be updated after creation and as you mention in the documentation, if not specified, generated values are returned.

@ewbankkit A huge thanks for polishing and merging this PR :-)

I have one question:

  • Does the presence of ForceNew alongside Computed allow users to specify a value for consumer_group_id upon resource creation?

Consumer_group_id should be specifiable upon creation of the resource. But in the docs, I read that

Computed is often used to represent values that are not user configurable [...] Computed can be combined with other attributes to achieve specific behaviors [...]

Thank you -- just double checking 🦅

@ewbankkit
Copy link
Contributor

ewbankkit commented Sep 1, 2022

@A122943 You are correct that an attribute marked with just Computed cannot be specified by the user, but with an additional Optional (which these new attributes do have) they can be configured.

@github-actions
Copy link

github-actions bot commented Sep 2, 2022

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

@github-actions
Copy link

github-actions bot commented Oct 4, 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 Oct 4, 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. enhancement Requests to existing resources that expand the functionality or scope. service/lambda Issues and PRs that pertain to the lambda service. size/XL 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.

Self-Managed Kafka Event Source Mapping: Optionally specify consumer_group_id upon resource creation
4 participants