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

resource/aws_lambda_event_source_mapping & resource/aws_lambda_code_signing_config: Add tags support #39535

Conversation

trutled3
Copy link
Contributor

Description

This pull request adds support for managing tags on both the aws_lambda_event_source_mapping and aws_lambda_code_signing_config resources. This was recently added to the associated AWS APIs on Sept 23, 2024.

Relations

Closes #39468

References

Output from Acceptance Testing

% TF_ACC=1 go test ./internal/service/lambda/... -v -count 1 -parallel 20 -run='TestAccLambdaCodeSigningConfig_Tags' -timeout 360m
=== RUN   TestAccLambdaCodeSigningConfig_Tags
=== PAUSE TestAccLambdaCodeSigningConfig_Tags
=== CONT  TestAccLambdaCodeSigningConfig_Tags
--- PASS: TestAccLambdaCodeSigningConfig_Tags (13.96s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/lambda     19.070s

% TF_ACC=1 go test ./internal/service/lambda/... -v -count 1 -parallel 20 -run='TestAccLambdaEventSourceMapping_Tags' -timeout 360m
=== RUN   TestAccLambdaEventSourceMapping_Tags
=== PAUSE TestAccLambdaEventSourceMapping_Tags
=== CONT  TestAccLambdaEventSourceMapping_Tags
--- PASS: TestAccLambdaEventSourceMapping_Tags (46.38s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/lambda     51.508s

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. service/emr Issues and PRs that pertain to the emr service. needs-triage Waiting for first response or review from a maintainer. labels Sep 30, 2024
@trutled3 trutled3 marked this pull request as ready for review September 30, 2024 18:45
@trutled3 trutled3 requested a review from a team as a code owner September 30, 2024 18:45
@ewbankkit ewbankkit self-assigned this Sep 30, 2024
@github-actions github-actions bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Sep 30, 2024
@jar-b jar-b removed the needs-triage Waiting for first response or review from a maintainer. label Sep 30, 2024
@ewbankkit ewbankkit added the tags Pertains to resource tagging. label Oct 1, 2024
@ewbankkit ewbankkit removed the service/emr Issues and PRs that pertain to the emr service. label Oct 1, 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 🚀.

AWS Commercial

% make testacc TESTARGS='-run=TestAccLambdaCodeSigningConfig_\|TestAccLambdaEventSourceMapping_tags\|TestAccLambdaEventSourceMapping_Kinesis_' PKG=lambda ACCTEST_PARALLELISM=3
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.1 test ./internal/service/lambda/... -v -count 1 -parallel 3  -run=TestAccLambdaCodeSigningConfig_\|TestAccLambdaEventSourceMapping_tags\|TestAccLambdaEventSourceMapping_Kinesis_ -timeout 360m
=== RUN   TestAccLambdaCodeSigningConfig_basic
=== PAUSE TestAccLambdaCodeSigningConfig_basic
=== RUN   TestAccLambdaCodeSigningConfig_disappears
=== PAUSE TestAccLambdaCodeSigningConfig_disappears
=== RUN   TestAccLambdaCodeSigningConfig_tags
=== PAUSE TestAccLambdaCodeSigningConfig_tags
=== RUN   TestAccLambdaCodeSigningConfig_updatePolicy
=== PAUSE TestAccLambdaCodeSigningConfig_updatePolicy
=== RUN   TestAccLambdaCodeSigningConfig_updatePublishers
=== PAUSE TestAccLambdaCodeSigningConfig_updatePublishers
=== RUN   TestAccLambdaEventSourceMapping_Kinesis_basic
=== PAUSE TestAccLambdaEventSourceMapping_Kinesis_basic
=== RUN   TestAccLambdaEventSourceMapping_tags
=== PAUSE TestAccLambdaEventSourceMapping_tags
=== 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  TestAccLambdaCodeSigningConfig_basic
=== CONT  TestAccLambdaEventSourceMapping_Kinesis_parallelizationFactor
=== CONT  TestAccLambdaEventSourceMapping_Kinesis_basic
--- PASS: TestAccLambdaCodeSigningConfig_basic (14.97s)
=== CONT  TestAccLambdaCodeSigningConfig_updatePolicy
--- PASS: TestAccLambdaCodeSigningConfig_updatePolicy (22.04s)
=== CONT  TestAccLambdaCodeSigningConfig_updatePublishers
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_parallelizationFactor (56.67s)
=== CONT  TestAccLambdaCodeSigningConfig_tags
--- PASS: TestAccLambdaCodeSigningConfig_updatePublishers (21.76s)
=== CONT  TestAccLambdaEventSourceMapping_Kinesis_maximumRecordAgeInSeconds
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_basic (67.08s)
=== CONT  TestAccLambdaEventSourceMapping_Kinesis_destination
--- PASS: TestAccLambdaCodeSigningConfig_tags (30.37s)
=== CONT  TestAccLambdaEventSourceMapping_Kinesis_bisectBatch
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_maximumRecordAgeInSeconds (55.68s)
=== CONT  TestAccLambdaEventSourceMapping_Kinesis_maximumRecordAgeInSecondsNegativeOne
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_destination (57.06s)
=== CONT  TestAccLambdaCodeSigningConfig_disappears
--- PASS: TestAccLambdaCodeSigningConfig_disappears (11.87s)
=== CONT  TestAccLambdaEventSourceMapping_Kinesis_maximumRetryAttempts
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_bisectBatch (55.87s)
=== CONT  TestAccLambdaEventSourceMapping_Kinesis_startingPositionTimestamp
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_maximumRecordAgeInSecondsNegativeOne (55.79s)
=== CONT  TestAccLambdaEventSourceMapping_Kinesis_batchWindow
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_startingPositionTimestamp (46.38s)
=== CONT  TestAccLambdaEventSourceMapping_tags
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_maximumRetryAttempts (55.95s)
=== CONT  TestAccLambdaEventSourceMapping_Kinesis_maximumRetryAttemptsNegativeOne
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_batchWindow (55.84s)
=== CONT  TestAccLambdaEventSourceMapping_Kinesis_tumblingWindowInSeconds
--- PASS: TestAccLambdaEventSourceMapping_tags (65.37s)
=== CONT  TestAccLambdaEventSourceMapping_Kinesis_maximumRetryAttemptsZero
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_maximumRetryAttemptsNegativeOne (65.61s)
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_tumblingWindowInSeconds (56.43s)
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_maximumRetryAttemptsZero (65.75s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/lambda	325.842s

AWS US GovCloud

% make testacc TESTARGS='-run=TestAccLambdaCodeSigningConfig_\|TestAccLambdaEventSourceMapping_tags\|TestAccLambdaEventSourceMapping_Kinesis_' PKG=lambda ACCTEST_PARALLELISM=3
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.1 test ./internal/service/lambda/... -v -count 1 -parallel 3  -run=TestAccLambdaCodeSigningConfig_\|TestAccLambdaEventSourceMapping_tags\|TestAccLambdaEventSourceMapping_Kinesis_ -timeout 360m
=== RUN   TestAccLambdaCodeSigningConfig_basic
=== PAUSE TestAccLambdaCodeSigningConfig_basic
=== RUN   TestAccLambdaCodeSigningConfig_disappears
=== PAUSE TestAccLambdaCodeSigningConfig_disappears
=== RUN   TestAccLambdaCodeSigningConfig_tags
=== PAUSE TestAccLambdaCodeSigningConfig_tags
=== RUN   TestAccLambdaCodeSigningConfig_updatePolicy
=== PAUSE TestAccLambdaCodeSigningConfig_updatePolicy
=== RUN   TestAccLambdaCodeSigningConfig_updatePublishers
=== PAUSE TestAccLambdaCodeSigningConfig_updatePublishers
=== RUN   TestAccLambdaEventSourceMapping_Kinesis_basic
=== PAUSE TestAccLambdaEventSourceMapping_Kinesis_basic
=== RUN   TestAccLambdaEventSourceMapping_tags
=== PAUSE TestAccLambdaEventSourceMapping_tags
=== 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  TestAccLambdaCodeSigningConfig_basic
=== CONT  TestAccLambdaEventSourceMapping_Kinesis_parallelizationFactor
=== CONT  TestAccLambdaEventSourceMapping_Kinesis_maximumRecordAgeInSeconds
=== NAME  TestAccLambdaCodeSigningConfig_basic
    code_signing_config_test.go:32: skipping tests; current partition (aws-us-gov) not supported
--- SKIP: TestAccLambdaCodeSigningConfig_basic (0.37s)
=== CONT  TestAccLambdaEventSourceMapping_Kinesis_bisectBatch
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_parallelizationFactor (56.69s)
=== CONT  TestAccLambdaEventSourceMapping_Kinesis_destination
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_bisectBatch (56.40s)
=== CONT  TestAccLambdaEventSourceMapping_Kinesis_basic
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_maximumRecordAgeInSeconds (61.10s)
=== CONT  TestAccLambdaEventSourceMapping_Kinesis_batchWindow
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_basic (66.06s)
=== CONT  TestAccLambdaEventSourceMapping_Kinesis_startingPositionTimestamp
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_destination (56.79s)
=== CONT  TestAccLambdaEventSourceMapping_tags
    event_source_mapping_test.go:127: skipping tests; current partition (aws-us-gov) not supported
--- SKIP: TestAccLambdaEventSourceMapping_tags (0.00s)
=== CONT  TestAccLambdaEventSourceMapping_Kinesis_maximumRecordAgeInSecondsNegativeOne
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_batchWindow (56.33s)
=== CONT  TestAccLambdaCodeSigningConfig_updatePolicy
    code_signing_config_test.go:141: skipping tests; current partition (aws-us-gov) not supported
--- SKIP: TestAccLambdaCodeSigningConfig_updatePolicy (0.00s)
=== CONT  TestAccLambdaCodeSigningConfig_updatePublishers
    code_signing_config_test.go:181: skipping tests; current partition (aws-us-gov) not supported
--- SKIP: TestAccLambdaCodeSigningConfig_updatePublishers (0.00s)
=== CONT  TestAccLambdaEventSourceMapping_Kinesis_maximumRetryAttemptsZero
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_startingPositionTimestamp (45.72s)
=== CONT  TestAccLambdaEventSourceMapping_Kinesis_maximumRetryAttemptsNegativeOne
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_maximumRecordAgeInSecondsNegativeOne (55.32s)
=== CONT  TestAccLambdaCodeSigningConfig_tags
    code_signing_config_test.go:93: skipping tests; current partition (aws-us-gov) not supported
--- SKIP: TestAccLambdaCodeSigningConfig_tags (0.00s)
=== CONT  TestAccLambdaEventSourceMapping_Kinesis_maximumRetryAttempts
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_maximumRetryAttemptsZero (64.64s)
=== CONT  TestAccLambdaEventSourceMapping_Kinesis_tumblingWindowInSeconds
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_maximumRetryAttemptsNegativeOne (64.46s)
=== CONT  TestAccLambdaCodeSigningConfig_disappears
    code_signing_config_test.go:66: skipping tests; current partition (aws-us-gov) not supported
--- SKIP: TestAccLambdaCodeSigningConfig_disappears (0.00s)
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_maximumRetryAttempts (54.95s)
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_tumblingWindowInSeconds (55.29s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/lambda	242.681s

@ewbankkit
Copy link
Contributor

@trutled3 Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit fc016af into hashicorp:main Oct 1, 2024
40 checks passed
@github-actions github-actions bot added this to the v5.70.0 milestone Oct 1, 2024
@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Oct 4, 2024
Copy link

github-actions bot commented Oct 4, 2024

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

@cycleandsoak
Copy link

We are having some trouble with default tags that looks like it may be related to this pull request. We have opened a bug report here - #39820, and have published a reproduction here - https://github.com/cycleandsoak/lambda-event-source-mapping-tagging-error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Introduces or discusses updates to documentation. service/lambda Issues and PRs that pertain to the lambda service. tags Pertains to resource tagging. 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.

Lambda now supports tagging of Event Source Mappings and Code Signing Config resources
4 participants