-
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
fix(service/lambda): Corrected EventSourceMapping valid range for maxmum_retry_attempts and maximum_record_age_in_seconds #16113
fix(service/lambda): Corrected EventSourceMapping valid range for maxmum_retry_attempts and maximum_record_age_in_seconds #16113
Conversation
Verified in the AWS API reference that these minimum values are correct: |
It turns out that the documentation for
I'll address this while merging this PR. |
e7e1eb5
to
d8efb21
Compare
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 🚀.
Commercial
% make testacc TEST=./aws TESTARGS='-run=TestAccAWSLambdaEventSourceMapping_' ACCTEST_PARALLELISM=4
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 4 -run=TestAccAWSLambdaEventSourceMapping_ -timeout 180m
=== RUN TestAccAWSLambdaEventSourceMapping_kinesis_basic
=== PAUSE TestAccAWSLambdaEventSourceMapping_kinesis_basic
=== RUN TestAccAWSLambdaEventSourceMapping_kinesis_removeBatchSize
=== PAUSE TestAccAWSLambdaEventSourceMapping_kinesis_removeBatchSize
=== RUN TestAccAWSLambdaEventSourceMapping_sqs_basic
=== PAUSE TestAccAWSLambdaEventSourceMapping_sqs_basic
=== RUN TestAccAWSLambdaEventSourceMapping_sqs_withFunctionName
=== PAUSE TestAccAWSLambdaEventSourceMapping_sqs_withFunctionName
=== RUN TestAccAWSLambdaEventSourceMapping_SQSBatchWindow
=== PAUSE TestAccAWSLambdaEventSourceMapping_SQSBatchWindow
=== RUN TestAccAWSLambdaEventSourceMapping_disappears
=== PAUSE TestAccAWSLambdaEventSourceMapping_disappears
=== RUN TestAccAWSLambdaEventSourceMapping_changesInEnabledAreDetected
=== PAUSE TestAccAWSLambdaEventSourceMapping_changesInEnabledAreDetected
=== RUN TestAccAWSLambdaEventSourceMapping_StartingPositionTimestamp
=== PAUSE TestAccAWSLambdaEventSourceMapping_StartingPositionTimestamp
=== RUN TestAccAWSLambdaEventSourceMapping_KinesisBatchWindow
=== PAUSE TestAccAWSLambdaEventSourceMapping_KinesisBatchWindow
=== RUN TestAccAWSLambdaEventSourceMapping_ParallelizationFactor
=== PAUSE TestAccAWSLambdaEventSourceMapping_ParallelizationFactor
=== RUN TestAccAWSLambdaEventSourceMapping_MaximumRetryAttempts
=== PAUSE TestAccAWSLambdaEventSourceMapping_MaximumRetryAttempts
=== RUN TestAccAWSLambdaEventSourceMapping_MaximumRetryAttemptsZero
=== PAUSE TestAccAWSLambdaEventSourceMapping_MaximumRetryAttemptsZero
=== RUN TestAccAWSLambdaEventSourceMapping_MaximumRetryAttemptsNegativeOne
=== PAUSE TestAccAWSLambdaEventSourceMapping_MaximumRetryAttemptsNegativeOne
=== RUN TestAccAWSLambdaEventSourceMapping_MaximumRecordAgeInSeconds
=== PAUSE TestAccAWSLambdaEventSourceMapping_MaximumRecordAgeInSeconds
=== RUN TestAccAWSLambdaEventSourceMapping_MaximumRecordAgeInSecondsNegativeOne
=== PAUSE TestAccAWSLambdaEventSourceMapping_MaximumRecordAgeInSecondsNegativeOne
=== RUN TestAccAWSLambdaEventSourceMapping_BisectBatch
=== PAUSE TestAccAWSLambdaEventSourceMapping_BisectBatch
=== RUN TestAccAWSLambdaEventSourceMapping_KinesisDestinationConfig
=== PAUSE TestAccAWSLambdaEventSourceMapping_KinesisDestinationConfig
=== RUN TestAccAWSLambdaEventSourceMapping_MSK
=== PAUSE TestAccAWSLambdaEventSourceMapping_MSK
=== CONT TestAccAWSLambdaEventSourceMapping_kinesis_basic
=== CONT TestAccAWSLambdaEventSourceMapping_MaximumRetryAttemptsNegativeOne
=== CONT TestAccAWSLambdaEventSourceMapping_changesInEnabledAreDetected
=== CONT TestAccAWSLambdaEventSourceMapping_KinesisDestinationConfig
--- PASS: TestAccAWSLambdaEventSourceMapping_KinesisDestinationConfig (74.02s)
=== CONT TestAccAWSLambdaEventSourceMapping_MaximumRetryAttemptsZero
--- PASS: TestAccAWSLambdaEventSourceMapping_MaximumRetryAttemptsNegativeOne (85.17s)
=== CONT TestAccAWSLambdaEventSourceMapping_MaximumRetryAttempts
--- PASS: TestAccAWSLambdaEventSourceMapping_kinesis_basic (90.36s)
=== CONT TestAccAWSLambdaEventSourceMapping_ParallelizationFactor
--- PASS: TestAccAWSLambdaEventSourceMapping_changesInEnabledAreDetected (120.59s)
=== CONT TestAccAWSLambdaEventSourceMapping_KinesisBatchWindow
--- PASS: TestAccAWSLambdaEventSourceMapping_MaximumRetryAttempts (70.96s)
=== CONT TestAccAWSLambdaEventSourceMapping_StartingPositionTimestamp
--- PASS: TestAccAWSLambdaEventSourceMapping_MaximumRetryAttemptsZero (83.31s)
=== CONT TestAccAWSLambdaEventSourceMapping_MaximumRecordAgeInSecondsNegativeOne
--- PASS: TestAccAWSLambdaEventSourceMapping_ParallelizationFactor (70.78s)
=== CONT TestAccAWSLambdaEventSourceMapping_BisectBatch
--- PASS: TestAccAWSLambdaEventSourceMapping_KinesisBatchWindow (69.62s)
=== CONT TestAccAWSLambdaEventSourceMapping_sqs_withFunctionName
--- PASS: TestAccAWSLambdaEventSourceMapping_StartingPositionTimestamp (57.35s)
=== CONT TestAccAWSLambdaEventSourceMapping_MaximumRecordAgeInSeconds
--- PASS: TestAccAWSLambdaEventSourceMapping_MaximumRecordAgeInSecondsNegativeOne (69.73s)
=== CONT TestAccAWSLambdaEventSourceMapping_disappears
--- PASS: TestAccAWSLambdaEventSourceMapping_sqs_withFunctionName (37.27s)
=== CONT TestAccAWSLambdaEventSourceMapping_SQSBatchWindow
--- PASS: TestAccAWSLambdaEventSourceMapping_BisectBatch (70.53s)
=== CONT TestAccAWSLambdaEventSourceMapping_kinesis_removeBatchSize
--- PASS: TestAccAWSLambdaEventSourceMapping_MaximumRecordAgeInSeconds (70.02s)
=== CONT TestAccAWSLambdaEventSourceMapping_MSK
--- PASS: TestAccAWSLambdaEventSourceMapping_SQSBatchWindow (61.22s)
=== CONT TestAccAWSLambdaEventSourceMapping_sqs_basic
--- PASS: TestAccAWSLambdaEventSourceMapping_disappears (77.41s)
--- PASS: TestAccAWSLambdaEventSourceMapping_kinesis_removeBatchSize (77.90s)
--- PASS: TestAccAWSLambdaEventSourceMapping_sqs_basic (103.49s)
--- PASS: TestAccAWSLambdaEventSourceMapping_MSK (2061.94s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 2348.510s
GovCloud
% make testacc TEST=./aws TESTARGS='-run=TestAccAWSLambdaEventSourceMapping_' ACCTEST_PARALLELISM=4
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 4 -run=TestAccAWSLambdaEventSourceMapping_ -timeout 180m
=== RUN TestAccAWSLambdaEventSourceMapping_kinesis_basic
=== PAUSE TestAccAWSLambdaEventSourceMapping_kinesis_basic
=== RUN TestAccAWSLambdaEventSourceMapping_kinesis_removeBatchSize
=== PAUSE TestAccAWSLambdaEventSourceMapping_kinesis_removeBatchSize
=== RUN TestAccAWSLambdaEventSourceMapping_sqs_basic
=== PAUSE TestAccAWSLambdaEventSourceMapping_sqs_basic
=== RUN TestAccAWSLambdaEventSourceMapping_sqs_withFunctionName
=== PAUSE TestAccAWSLambdaEventSourceMapping_sqs_withFunctionName
=== RUN TestAccAWSLambdaEventSourceMapping_SQSBatchWindow
=== PAUSE TestAccAWSLambdaEventSourceMapping_SQSBatchWindow
=== RUN TestAccAWSLambdaEventSourceMapping_disappears
=== PAUSE TestAccAWSLambdaEventSourceMapping_disappears
=== RUN TestAccAWSLambdaEventSourceMapping_changesInEnabledAreDetected
=== PAUSE TestAccAWSLambdaEventSourceMapping_changesInEnabledAreDetected
=== RUN TestAccAWSLambdaEventSourceMapping_StartingPositionTimestamp
=== PAUSE TestAccAWSLambdaEventSourceMapping_StartingPositionTimestamp
=== RUN TestAccAWSLambdaEventSourceMapping_KinesisBatchWindow
=== PAUSE TestAccAWSLambdaEventSourceMapping_KinesisBatchWindow
=== RUN TestAccAWSLambdaEventSourceMapping_ParallelizationFactor
=== PAUSE TestAccAWSLambdaEventSourceMapping_ParallelizationFactor
=== RUN TestAccAWSLambdaEventSourceMapping_MaximumRetryAttempts
=== PAUSE TestAccAWSLambdaEventSourceMapping_MaximumRetryAttempts
=== RUN TestAccAWSLambdaEventSourceMapping_MaximumRetryAttemptsZero
=== PAUSE TestAccAWSLambdaEventSourceMapping_MaximumRetryAttemptsZero
=== RUN TestAccAWSLambdaEventSourceMapping_MaximumRetryAttemptsNegativeOne
=== PAUSE TestAccAWSLambdaEventSourceMapping_MaximumRetryAttemptsNegativeOne
=== RUN TestAccAWSLambdaEventSourceMapping_MaximumRecordAgeInSeconds
=== PAUSE TestAccAWSLambdaEventSourceMapping_MaximumRecordAgeInSeconds
=== RUN TestAccAWSLambdaEventSourceMapping_MaximumRecordAgeInSecondsNegativeOne
=== PAUSE TestAccAWSLambdaEventSourceMapping_MaximumRecordAgeInSecondsNegativeOne
=== RUN TestAccAWSLambdaEventSourceMapping_BisectBatch
=== PAUSE TestAccAWSLambdaEventSourceMapping_BisectBatch
=== RUN TestAccAWSLambdaEventSourceMapping_KinesisDestinationConfig
=== PAUSE TestAccAWSLambdaEventSourceMapping_KinesisDestinationConfig
=== RUN TestAccAWSLambdaEventSourceMapping_MSK
=== PAUSE TestAccAWSLambdaEventSourceMapping_MSK
=== CONT TestAccAWSLambdaEventSourceMapping_kinesis_basic
=== CONT TestAccAWSLambdaEventSourceMapping_MaximumRetryAttempts
=== CONT TestAccAWSLambdaEventSourceMapping_MSK
=== CONT TestAccAWSLambdaEventSourceMapping_KinesisDestinationConfig
--- PASS: TestAccAWSLambdaEventSourceMapping_MaximumRetryAttempts (82.65s)
=== CONT TestAccAWSLambdaEventSourceMapping_BisectBatch
--- PASS: TestAccAWSLambdaEventSourceMapping_kinesis_basic (83.96s)
=== CONT TestAccAWSLambdaEventSourceMapping_MaximumRecordAgeInSecondsNegativeOne
--- PASS: TestAccAWSLambdaEventSourceMapping_KinesisDestinationConfig (84.95s)
=== CONT TestAccAWSLambdaEventSourceMapping_MaximumRecordAgeInSeconds
--- PASS: TestAccAWSLambdaEventSourceMapping_BisectBatch (79.68s)
=== CONT TestAccAWSLambdaEventSourceMapping_MaximumRetryAttemptsNegativeOne
--- PASS: TestAccAWSLambdaEventSourceMapping_MaximumRecordAgeInSecondsNegativeOne (79.47s)
=== CONT TestAccAWSLambdaEventSourceMapping_MaximumRetryAttemptsZero
--- PASS: TestAccAWSLambdaEventSourceMapping_MaximumRecordAgeInSeconds (80.36s)
=== CONT TestAccAWSLambdaEventSourceMapping_disappears
--- PASS: TestAccAWSLambdaEventSourceMapping_disappears (76.54s)
=== CONT TestAccAWSLambdaEventSourceMapping_ParallelizationFactor
--- PASS: TestAccAWSLambdaEventSourceMapping_MaximumRetryAttemptsNegativeOne (96.89s)
=== CONT TestAccAWSLambdaEventSourceMapping_KinesisBatchWindow
--- PASS: TestAccAWSLambdaEventSourceMapping_MaximumRetryAttemptsZero (97.97s)
=== CONT TestAccAWSLambdaEventSourceMapping_StartingPositionTimestamp
--- PASS: TestAccAWSLambdaEventSourceMapping_ParallelizationFactor (80.13s)
=== CONT TestAccAWSLambdaEventSourceMapping_changesInEnabledAreDetected
--- PASS: TestAccAWSLambdaEventSourceMapping_StartingPositionTimestamp (62.51s)
=== CONT TestAccAWSLambdaEventSourceMapping_sqs_withFunctionName
--- PASS: TestAccAWSLambdaEventSourceMapping_KinesisBatchWindow (80.79s)
=== CONT TestAccAWSLambdaEventSourceMapping_SQSBatchWindow
--- PASS: TestAccAWSLambdaEventSourceMapping_sqs_withFunctionName (42.37s)
=== CONT TestAccAWSLambdaEventSourceMapping_sqs_basic
--- PASS: TestAccAWSLambdaEventSourceMapping_SQSBatchWindow (52.38s)
=== CONT TestAccAWSLambdaEventSourceMapping_kinesis_removeBatchSize
--- PASS: TestAccAWSLambdaEventSourceMapping_changesInEnabledAreDetected (77.93s)
--- PASS: TestAccAWSLambdaEventSourceMapping_kinesis_removeBatchSize (77.29s)
--- PASS: TestAccAWSLambdaEventSourceMapping_sqs_basic (120.39s)
=== CONT TestAccAWSLambdaEventSourceMapping_MSK
resource_aws_lambda_event_source_mapping_test.go:733: Step 1/2 error: Error running apply: exit status 1
2021/04/23 10:23:10 [DEBUG] Using modified User-Agent: Terraform/0.12.30 HashiCorp-terraform-exec/0.13.0
Error: error creating Lambda Event Source Mapping (): InvalidParameterValueException: Unsupported source arn : arn:aws-us-gov:kafka:us-gov-west-1:357342307427:cluster/tf-acc-test-9148183352340101037/7fe49ffa-2234-426c-b6bf-90d062d8f786-3
{
RespMetadata: {
StatusCode: 400,
RequestID: "d06d03a0-db95-4cf9-8370-7e4fe0747dfd"
},
Message_: "Unsupported source arn : arn:aws-us-gov:kafka:us-gov-west-1:357342307427:cluster/tf-acc-test-9148183352340101037/7fe49ffa-2234-426c-b6bf-90d062d8f786-3",
Type: "User"
}
on terraform_plugin_test.tf line 116, in resource "aws_lambda_event_source_mapping" "test":
116: resource "aws_lambda_event_source_mapping" "test" {
--- FAIL: TestAccAWSLambdaEventSourceMapping_MSK (1529.12s)
FAIL
FAIL github.com/terraform-providers/terraform-provider-aws/aws 1532.122s
FAIL
make: *** [testacc] Error 1
That failure is not new and is unrelated to this change.
…imum_retry_attempts and maximum_record_age_in_seconds Updated the minimum value to `-1` as specified in the AWS docs.
…st be either -1 (forever) or between 60 and 604800 (inclusive).
d8efb21
to
42c9f6f
Compare
@raytung Thanks for the contribution 👏. |
Nice catch! I should've tested this more thoroughly. Thanks for your effort, @ewbankkit! |
This has been released in version 3.38.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 for triage. Thanks! |
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. |
Hey team, 👋
This is my first contribution here, please let me know if I've missed anything! 😃
Corrected the minimum value for
maxmum_retry_attempts
andmaximum_record_age_in_seconds
to-1
as specified in the AWS docs.https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-maximumrecordageinseconds
Community Note
Release note for CHANGELOG:
Output from acceptance testing: