-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
Add MaxItems
to aws_lambda_event_source_mapping.queues
#31931
Conversation
Community NoteVoting for Prioritization
For Submitters
|
Note: Holding off on adding a changelog entry, as the linting errors make me curious as to whether we should back out the schema change, and instead make this a documentation only change. Will await review before making any additional commits. |
This seems like a reasonable change to me since the API has always only accepted 1 values in that list; terraform-provider-aws/internal/service/lambda/event_source_mapping.go Lines 429 to 431 in 314cf93
something like: if v, ok := d.GetOk("queues"); ok && len(v.([]interface{})) > 0 {
input.Queues = flex.ExpandStringList(v.([]interface{}))
} |
Tests after changes: ✖ make testacc TESTS=TestAccLambdaEventSourceMapping PKG=lambda
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/lambda/... -v -count 1 -parallel 20 -run='TestAccLambdaEventSourceMapping' -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_DynamoDB_streamAdded
=== PAUSE TestAccLambdaEventSourceMapping_DynamoDB_streamAdded
=== RUN TestAccLambdaEventSourceMapping_SQS_batchWindow
=== PAUSE TestAccLambdaEventSourceMapping_SQS_batchWindow
=== RUN TestAccLambdaEventSourceMapping_disappears
=== PAUSE TestAccLambdaEventSourceMapping_disappears
=== 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_msk
=== PAUSE TestAccLambdaEventSourceMapping_msk
=== RUN TestAccLambdaEventSourceMapping_mskWithEventSourceConfig
=== PAUSE TestAccLambdaEventSourceMapping_mskWithEventSourceConfig
=== RUN TestAccLambdaEventSourceMapping_selfManagedKafka
=== PAUSE TestAccLambdaEventSourceMapping_selfManagedKafka
=== RUN TestAccLambdaEventSourceMapping_selfManagedKafkaWithEventSourceConfig
=== PAUSE TestAccLambdaEventSourceMapping_selfManagedKafkaWithEventSourceConfig
=== RUN TestAccLambdaEventSourceMapping_activeMQ
=== PAUSE TestAccLambdaEventSourceMapping_activeMQ
=== RUN TestAccLambdaEventSourceMapping_rabbitMQ
=== PAUSE TestAccLambdaEventSourceMapping_rabbitMQ
=== RUN TestAccLambdaEventSourceMapping_SQS_filterCriteria
=== PAUSE TestAccLambdaEventSourceMapping_SQS_filterCriteria
=== RUN TestAccLambdaEventSourceMapping_SQS_scalingConfig
=== PAUSE TestAccLambdaEventSourceMapping_SQS_scalingConfig
=== RUN TestAccLambdaEventSourceMapping_documentDB
=== PAUSE TestAccLambdaEventSourceMapping_documentDB
=== CONT TestAccLambdaEventSourceMapping_Kinesis_basic
=== CONT TestAccLambdaEventSourceMapping_selfManagedKafka
=== CONT TestAccLambdaEventSourceMapping_Kinesis_tumblingWindowInSeconds
=== CONT TestAccLambdaEventSourceMapping_Kinesis_destination
=== CONT TestAccLambdaEventSourceMapping_Kinesis_parallelizationFactor
=== CONT TestAccLambdaEventSourceMapping_Kinesis_batchWindow
=== CONT TestAccLambdaEventSourceMapping_Kinesis_startingPositionTimestamp
=== CONT TestAccLambdaEventSourceMapping_Kinesis_maximumRetryAttemptsNegativeOne
=== CONT TestAccLambdaEventSourceMapping_Kinesis_bisectBatch
=== CONT TestAccLambdaEventSourceMapping_Kinesis_maximumRecordAgeInSecondsNegativeOne
=== CONT TestAccLambdaEventSourceMapping_Kinesis_maximumRecordAgeInSeconds
=== CONT TestAccLambdaEventSourceMapping_mskWithEventSourceConfig
=== CONT TestAccLambdaEventSourceMapping_SQS_filterCriteria
=== CONT TestAccLambdaEventSourceMapping_documentDB
=== CONT TestAccLambdaEventSourceMapping_SQS_scalingConfig
=== CONT TestAccLambdaEventSourceMapping_DynamoDB_streamAdded
=== CONT TestAccLambdaEventSourceMapping_disappears
=== CONT TestAccLambdaEventSourceMapping_SQS_batchWindow
=== CONT TestAccLambdaEventSourceMapping_msk
=== CONT TestAccLambdaEventSourceMapping_SQS_changesInEnabledAreDetected
--- PASS: TestAccLambdaEventSourceMapping_SQS_changesInEnabledAreDetected (89.58s)
=== CONT TestAccLambdaEventSourceMapping_Kinesis_maximumRetryAttemptsZero
=== CONT TestAccLambdaEventSourceMapping_DynamoDB_basic
--- PASS: TestAccLambdaEventSourceMapping_DynamoDB_streamAdded (93.64s)
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_bisectBatch (94.42s)
=== CONT TestAccLambdaEventSourceMapping_DynamoDB_functionResponseTypes
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_parallelizationFactor (106.55s)
=== CONT TestAccLambdaEventSourceMapping_SQS_basic
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_maximumRecordAgeInSeconds (115.92s)
=== CONT TestAccLambdaEventSourceMapping_Kinesis_maximumRetryAttempts
--- PASS: TestAccLambdaEventSourceMapping_SQS_batchWindow (143.24s)
=== CONT TestAccLambdaEventSourceMapping_activeMQ
--- PASS: TestAccLambdaEventSourceMapping_selfManagedKafka (146.17s)
=== CONT TestAccLambdaEventSourceMapping_rabbitMQ
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_maximumRetryAttemptsNegativeOne (156.87s)
=== CONT TestAccLambdaEventSourceMapping_selfManagedKafkaWithEventSourceConfig
=== NAME TestAccLambdaEventSourceMapping_documentDB
event_source_mapping_test.go:1180: Step 1/2 error: Error running apply: exit status 1
Error: creating DocumentDB cluster: DBClusterParameterGroupNotFound: DBClusterParameterGroup not found: default.docdb4.0
status code: 404, request id: a7309b8e-f120-49c4-9ed4-d969c6470efa
with aws_docdb_cluster.test,
on terraform_plugin_test.tf line 106, in resource "aws_docdb_cluster" "test":
106: resource "aws_docdb_cluster" "test" {
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_startingPositionTimestamp (164.04s)
--- FAIL: TestAccLambdaEventSourceMapping_documentDB (165.92s)
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_tumblingWindowInSeconds (173.65s)
--- PASS: TestAccLambdaEventSourceMapping_disappears (178.75s)
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_batchWindow (189.79s)
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_destination (201.21s)
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_maximumRecordAgeInSecondsNegativeOne (209.18s)
--- PASS: TestAccLambdaEventSourceMapping_SQS_scalingConfig (209.60s)
--- PASS: TestAccLambdaEventSourceMapping_DynamoDB_functionResponseTypes (130.82s)
--- PASS: TestAccLambdaEventSourceMapping_DynamoDB_basic (139.10s)
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_basic (233.64s)
--- PASS: TestAccLambdaEventSourceMapping_selfManagedKafkaWithEventSourceConfig (79.46s)
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_maximumRetryAttemptsZero (149.12s)
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_maximumRetryAttempts (126.17s)
--- PASS: TestAccLambdaEventSourceMapping_SQS_filterCriteria (281.02s)
--- PASS: TestAccLambdaEventSourceMapping_SQS_basic (185.22s)
--- PASS: TestAccLambdaEventSourceMapping_rabbitMQ (624.27s)
--- PASS: TestAccLambdaEventSourceMapping_activeMQ (1029.65s)
--- PASS: TestAccLambdaEventSourceMapping_mskWithEventSourceConfig (3282.95s)
--- PASS: TestAccLambdaEventSourceMapping_msk (3313.43s)
FAIL
FAIL github.com/hashicorp/terraform-provider-aws/internal/service/lambda 3316.604s
FAIL
make: *** [testacc] Error 1 |
There was a problem hiding this 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_' PKG=lambda
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/lambda/... -v -count 1 -parallel 20 -run=TestAccLambdaEventSourceMapping_ -timeout 180m
--- PASS: TestAccLambdaEventSourceMapping_disappears (79.70s)
--- PASS: TestAccLambdaEventSourceMapping_SQS_changesInEnabledAreDetected (80.92s)
--- PASS: TestAccLambdaEventSourceMapping_selfManagedKafka (99.32s)
--- PASS: TestAccLambdaEventSourceMapping_DynamoDB_streamAdded (100.35s)
--- PASS: TestAccLambdaEventSourceMapping_SQS_batchWindow (114.90s)
=== NAME TestAccLambdaEventSourceMapping_documentDB
event_source_mapping_test.go:1180: Step 1/2 error: Error running apply: exit status 1
Error: creating DocumentDB cluster: InvalidParameterCombination: The Parameter Group default.docdb4.0 with DBParameterGroupFamily docdb4.0 cannot be used for this instance. Please use a Parameter Group with DBParameterGroupFamily docdb5.0
status code: 400, request id: d983b938-c579-4ac7-9cb0-83f9247510f8
with aws_docdb_cluster.test,
on terraform_plugin_test.tf line 106, in resource "aws_docdb_cluster" "test":
106: resource "aws_docdb_cluster" "test" {
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_tumblingWindowInSeconds (117.09s)
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_maximumRetryAttemptsZero (118.67s)
--- FAIL: TestAccLambdaEventSourceMapping_documentDB (119.71s)
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_maximumRetryAttempts (127.05s)
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_batchWindow (138.95s)
--- PASS: TestAccLambdaEventSourceMapping_selfManagedKafkaWithEventSourceConfig (152.22s)
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_maximumRetryAttemptsNegativeOne (165.15s)
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_destination (168.52s)
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_startingPositionTimestamp (170.57s)
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_basic (173.20s)
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_parallelizationFactor (178.96s)
--- PASS: TestAccLambdaEventSourceMapping_SQS_filterCriteria (197.61s)
--- PASS: TestAccLambdaEventSourceMapping_SQS_scalingConfig (205.27s)
--- PASS: TestAccLambdaEventSourceMapping_DynamoDB_basic (115.69s)
--- PASS: TestAccLambdaEventSourceMapping_DynamoDB_functionResponseTypes (115.93s)
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_maximumRecordAgeInSecondsNegativeOne (109.05s)
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_bisectBatch (112.73s)
--- PASS: TestAccLambdaEventSourceMapping_Kinesis_maximumRecordAgeInSeconds (117.45s)
--- PASS: TestAccLambdaEventSourceMapping_SQS_basic (158.99s)
--- PASS: TestAccLambdaEventSourceMapping_rabbitMQ (801.03s)
--- PASS: TestAccLambdaEventSourceMapping_activeMQ (1140.29s)
--- PASS: TestAccLambdaEventSourceMapping_msk (3427.78s)
--- PASS: TestAccLambdaEventSourceMapping_mskWithEventSourceConfig (3454.14s)
FAIL
FAIL github.com/hashicorp/terraform-provider-aws/internal/service/lambda 3537.150s
FAIL
make: *** [testacc] Error 1
Test failure not related to code change
@justinretzolk we should add a CHANGELOG entry |
This functionality has been released in v5.6.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! |
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. |
Description
This PR adds
MaxItems: 1
to theaws_lambda_event_source_mapping.queues
argument, as this argument only accepts a single item. Documentation is also modified to reflect this requirement.While the AWS Go SDK
lambda.CreateEventSouceMappingInput
type'sQueues
field doesn't specify a limit of one item, the API documentation (linked below) does, and adding additional items leads to errors (see related issue):Relations
Closes #31919
References
CreateEventSourceMapping
documentationOutput from Acceptance Testing