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

fix(service/lambda): Corrected EventSourceMapping valid range for maxmum_retry_attempts and maximum_record_age_in_seconds #16113

Merged

Conversation

raytung
Copy link
Contributor

@raytung raytung commented Nov 10, 2020

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 and maximum_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

  • 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

Release note for CHANGELOG:

resource/aws_lambda_event_source_mapping: Corrected minimum value for `maxmum_retry_attempts` and `maximum_record_age_in_seconds` to `-1`

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccAWSLambdaEventSourceMapping_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSLambdaEventSourceMapping_ -timeout 120m
=== 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_kinesis_disappears
=== PAUSE TestAccAWSLambdaEventSourceMapping_kinesis_disappears
=== RUN   TestAccAWSLambdaEventSourceMapping_sqsDisappears
=== PAUSE TestAccAWSLambdaEventSourceMapping_sqsDisappears
=== RUN   TestAccAWSLambdaEventSourceMapping_changesInEnabledAreDetected
=== PAUSE TestAccAWSLambdaEventSourceMapping_changesInEnabledAreDetected
=== RUN   TestAccAWSLambdaEventSourceMapping_StartingPositionTimestamp
=== PAUSE TestAccAWSLambdaEventSourceMapping_StartingPositionTimestamp
=== RUN   TestAccAWSLambdaEventSourceMapping_BatchWindow
=== PAUSE TestAccAWSLambdaEventSourceMapping_BatchWindow
=== 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
=== CONT  TestAccAWSLambdaEventSourceMapping_kinesis_basic
=== CONT  TestAccAWSLambdaEventSourceMapping_ParallelizationFactor
=== CONT  TestAccAWSLambdaEventSourceMapping_changesInEnabledAreDetected
=== CONT  TestAccAWSLambdaEventSourceMapping_MaximumRecordAgeInSecondsNegativeOne
=== CONT  TestAccAWSLambdaEventSourceMapping_MaximumRetryAttemptsZero
=== CONT  TestAccAWSLambdaEventSourceMapping_MaximumRetryAttempts
=== CONT  TestAccAWSLambdaEventSourceMapping_kinesis_disappears
=== CONT  TestAccAWSLambdaEventSourceMapping_MaximumRetryAttemptsNegativeOne
=== CONT  TestAccAWSLambdaEventSourceMapping_sqsDisappears
=== CONT  TestAccAWSLambdaEventSourceMapping_BatchWindow
=== CONT  TestAccAWSLambdaEventSourceMapping_StartingPositionTimestamp
=== CONT  TestAccAWSLambdaEventSourceMapping_MaximumRecordAgeInSeconds
=== CONT  TestAccAWSLambdaEventSourceMapping_KinesisDestinationConfig
=== CONT  TestAccAWSLambdaEventSourceMapping_BisectBatch
=== CONT  TestAccAWSLambdaEventSourceMapping_sqs_basic
=== CONT  TestAccAWSLambdaEventSourceMapping_sqs_withFunctionName
=== CONT  TestAccAWSLambdaEventSourceMapping_kinesis_removeBatchSize
2020/11/10 20:57:34 [DEBUG] Creating Lambda event source mapping: source arn:aws:kinesis:us-west-2:773807500865:stream/tf-acc-test-6396600295789228044 to function arn:aws:lambda:us-west-2:773807500865:function:tf-acc-test-6396600295789228044
2020/11/10 20:57:34 [DEBUG] Waiting for state to become: [success]
2020/11/10 20:58:09 [DEBUG] Trying to get account information via sts:GetCallerIdentity
--- PASS: TestAccAWSLambdaEventSourceMapping_sqs_basic (185.41s)
2020/11/10 20:58:52 [DEBUG] Fetching Lambda Function: tf-acc-test-6396600295789228044
2020/11/10 20:58:53 [INFO] Setting Lambda tf-acc-test-6396600295789228044 file system configs []map[string]interface {}{} from API
2020/11/10 20:58:53 [INFO] Setting Lambda tf-acc-test-6396600295789228044 Layers []interface {}{} from API
2020/11/10 20:58:53 [INFO] Setting Lambda tf-acc-test-6396600295789228044 VPC config []map[string]interface {}(nil) from API
2020/11/10 20:58:53 [INFO] Setting Lambda tf-acc-test-6396600295789228044 environment []interface {}(nil) from API
--- PASS: TestAccAWSLambdaEventSourceMapping_MaximumRetryAttempts (189.63s)
2020/11/10 20:59:02 [DEBUG] Fetching Lambda Function: tf_acc_lambda_esm_basic_updated_zvwa4gjg
--- PASS: TestAccAWSLambdaEventSourceMapping_sqs_withFunctionName (211.95s)
2020/11/10 20:59:25 [DEBUG] Trying to get account information via sts:GetCallerIdentity
--- PASS: TestAccAWSLambdaEventSourceMapping_ParallelizationFactor (224.52s)
--- PASS: TestAccAWSLambdaEventSourceMapping_StartingPositionTimestamp (230.82s)
--- PASS: TestAccAWSLambdaEventSourceMapping_sqsDisappears (237.79s)
2020/11/10 20:59:57 [DEBUG] Trying to get account information via sts:GetCallerIdentity
2020/11/10 21:00:09 [DEBUG] Trying to get account information via sts:GetCallerIdentity
--- PASS: TestAccAWSLambdaEventSourceMapping_changesInEnabledAreDetected (264.40s)
--- PASS: TestAccAWSLambdaEventSourceMapping_MaximumRecordAgeInSeconds (279.37s)
2020/11/10 21:00:42 [INFO] Deleting Lambda Function: tf-acc-test-3765630195498303425
--- PASS: TestAccAWSLambdaEventSourceMapping_MaximumRecordAgeInSecondsNegativeOne (308.36s)
--- PASS: TestAccAWSLambdaEventSourceMapping_MaximumRetryAttemptsZero (308.81s)
--- PASS: TestAccAWSLambdaEventSourceMapping_KinesisDestinationConfig (321.20s)
--- PASS: TestAccAWSLambdaEventSourceMapping_kinesis_disappears (321.44s)
--- PASS: TestAccAWSLambdaEventSourceMapping_BatchWindow (324.39s)
--- PASS: TestAccAWSLambdaEventSourceMapping_kinesis_basic (342.11s)
--- PASS: TestAccAWSLambdaEventSourceMapping_BisectBatch (347.31s)
--- PASS: TestAccAWSLambdaEventSourceMapping_kinesis_removeBatchSize (366.48s)
--- PASS: TestAccAWSLambdaEventSourceMapping_MaximumRetryAttemptsNegativeOne (397.66s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	398.150s
...

@ghost ghost added size/M Managed by automation to categorize the size of a PR. service/lambda Issues and PRs that pertain to the lambda service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Nov 10, 2020
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Nov 10, 2020
@raytung raytung changed the title [wip] fix(service/lambda): Corrected EventSourceMapping valid range for maxmum_retry_attempts and maximum_record_age_in_seconds fix(service/lambda): Corrected EventSourceMapping valid range for maxmum_retry_attempts and maximum_record_age_in_seconds Nov 10, 2020
@raytung raytung marked this pull request as ready for review November 10, 2020 10:03
@raytung raytung requested a review from a team as a code owner November 10, 2020 10:03
Base automatically changed from master to main January 23, 2021 00:59
@ewbankkit
Copy link
Contributor

Verified in the AWS API reference that these minimum values are correct:
Screenshot 2021-03-03 081611

@ewbankkit ewbankkit removed the needs-triage Waiting for first response or review from a maintainer. label Mar 3, 2021
@ewbankkit ewbankkit self-assigned this Apr 23, 2021
@ewbankkit
Copy link
Contributor

ewbankkit commented Apr 23, 2021

It turns out that the documentation for MaximumRecordAgeInSeconds is not quite correct. If I use a value between 0 and 60 then the API returns and error when updating the resource:

error updating Lambda Event Source Mapping (26a05b45-76db-480b-883e-3bbdb9777f40): InvalidParameterValueException: MaximumRecordAgeInSeconds must be either -1 (forever) or between 60 and 604800 (inclusive)

I'll address this while merging this PR.

@ewbankkit ewbankkit force-pushed the b-aws_lambda_event_source_mapping-min_values branch from e7e1eb5 to d8efb21 Compare April 23, 2021 14:04
@ghost ghost added the documentation Introduces or discusses updates to documentation. label Apr 23, 2021
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 🚀.

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.

raytung and others added 4 commits April 23, 2021 11:00
…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).
@ewbankkit ewbankkit force-pushed the b-aws_lambda_event_source_mapping-min_values branch from d8efb21 to 42c9f6f Compare April 23, 2021 15:00
@ewbankkit
Copy link
Contributor

@raytung Thanks for the contribution 👏.

@ewbankkit ewbankkit merged commit 82f9a5f into hashicorp:main Apr 23, 2021
@github-actions github-actions bot added this to the v3.38.0 milestone Apr 23, 2021
@raytung
Copy link
Contributor Author

raytung commented Apr 26, 2021

It turns out that the documentation for MaximumRecordAgeInSeconds is not quite correct. If I use a value between 0 and 60 then the API returns and error when updating the resource:

error updating Lambda Event Source Mapping (26a05b45-76db-480b-883e-3bbdb9777f40): InvalidParameterValueException: MaximumRecordAgeInSeconds must be either -1 (forever) or between 60 and 604800 (inclusive)

I'll address this while merging this PR.

Nice catch! I should've tested this more thoroughly. Thanks for your effort, @ewbankkit!

@ghost
Copy link

ghost commented Apr 30, 2021

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!

@github-actions
Copy link

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 May 31, 2021
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. service/lambda Issues and PRs that pertain to the lambda service. size/M 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.

2 participants