-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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: Support reading starting_position
fields
#19253
Conversation
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.
Welcome @gmpify 👋
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 CONTRIBUTING 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! 😃
starting_position
)starting_position
fields
…osition_timestamp
… 'starting_position'.
73dbd4d
to
9f43319
Compare
@gmpify Thanks for the contribution 👏. |
…tion and add DynamoDB test.
1074ce8
to
8d3e1b3
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_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSLambdaEventSourceMapping_ -timeout 180m
=== RUN TestAccAWSLambdaEventSourceMapping_Kinesis_basic
=== PAUSE TestAccAWSLambdaEventSourceMapping_Kinesis_basic
=== RUN TestAccAWSLambdaEventSourceMapping_SQS_basic
=== PAUSE TestAccAWSLambdaEventSourceMapping_SQS_basic
=== RUN TestAccAWSLambdaEventSourceMapping_DynamoDB_basic
=== PAUSE TestAccAWSLambdaEventSourceMapping_DynamoDB_basic
=== RUN TestAccAWSLambdaEventSourceMapping_SQS_BatchWindow
=== PAUSE TestAccAWSLambdaEventSourceMapping_SQS_BatchWindow
=== RUN TestAccAWSLambdaEventSourceMapping_disappears
=== PAUSE TestAccAWSLambdaEventSourceMapping_disappears
=== RUN TestAccAWSLambdaEventSourceMapping_SQS_changesInEnabledAreDetected
=== PAUSE TestAccAWSLambdaEventSourceMapping_SQS_changesInEnabledAreDetected
=== RUN TestAccAWSLambdaEventSourceMapping_Kinesis_StartingPositionTimestamp
=== PAUSE TestAccAWSLambdaEventSourceMapping_Kinesis_StartingPositionTimestamp
=== RUN TestAccAWSLambdaEventSourceMapping_Kinesis_BatchWindow
=== PAUSE TestAccAWSLambdaEventSourceMapping_Kinesis_BatchWindow
=== RUN TestAccAWSLambdaEventSourceMapping_Kinesis_ParallelizationFactor
=== PAUSE TestAccAWSLambdaEventSourceMapping_Kinesis_ParallelizationFactor
=== RUN TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRetryAttempts
=== PAUSE TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRetryAttempts
=== RUN TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRetryAttemptsZero
=== PAUSE TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRetryAttemptsZero
=== RUN TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRetryAttemptsNegativeOne
=== PAUSE TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRetryAttemptsNegativeOne
=== RUN TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRecordAgeInSeconds
=== PAUSE TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRecordAgeInSeconds
=== RUN TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRecordAgeInSecondsNegativeOne
=== PAUSE TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRecordAgeInSecondsNegativeOne
=== RUN TestAccAWSLambdaEventSourceMapping_Kinesis_BisectBatch
=== PAUSE TestAccAWSLambdaEventSourceMapping_Kinesis_BisectBatch
=== RUN TestAccAWSLambdaEventSourceMapping_Kinesis_DestinationConfig
=== PAUSE TestAccAWSLambdaEventSourceMapping_Kinesis_DestinationConfig
=== RUN TestAccAWSLambdaEventSourceMapping_MSK
=== PAUSE TestAccAWSLambdaEventSourceMapping_MSK
=== CONT TestAccAWSLambdaEventSourceMapping_Kinesis_basic
=== CONT TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRetryAttempts
=== CONT TestAccAWSLambdaEventSourceMapping_MSK
=== CONT TestAccAWSLambdaEventSourceMapping_Kinesis_DestinationConfig
=== CONT TestAccAWSLambdaEventSourceMapping_Kinesis_BisectBatch
=== CONT TestAccAWSLambdaEventSourceMapping_Kinesis_BatchWindow
=== CONT TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRetryAttemptsZero
=== CONT TestAccAWSLambdaEventSourceMapping_Kinesis_ParallelizationFactor
=== CONT TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRecordAgeInSecondsNegativeOne
=== CONT TestAccAWSLambdaEventSourceMapping_SQS_BatchWindow
=== CONT TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRecordAgeInSeconds
=== CONT TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRetryAttemptsNegativeOne
=== CONT TestAccAWSLambdaEventSourceMapping_SQS_changesInEnabledAreDetected
=== CONT TestAccAWSLambdaEventSourceMapping_DynamoDB_basic
=== CONT TestAccAWSLambdaEventSourceMapping_Kinesis_StartingPositionTimestamp
=== CONT TestAccAWSLambdaEventSourceMapping_SQS_basic
=== CONT TestAccAWSLambdaEventSourceMapping_disappears
--- PASS: TestAccAWSLambdaEventSourceMapping_Kinesis_BisectBatch (79.31s)
--- PASS: TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRetryAttempts (79.34s)
--- PASS: TestAccAWSLambdaEventSourceMapping_DynamoDB_basic (80.84s)
--- PASS: TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRecordAgeInSeconds (83.32s)
--- PASS: TestAccAWSLambdaEventSourceMapping_Kinesis_BatchWindow (90.16s)
--- PASS: TestAccAWSLambdaEventSourceMapping_SQS_BatchWindow (94.76s)
--- PASS: TestAccAWSLambdaEventSourceMapping_Kinesis_StartingPositionTimestamp (129.37s)
--- PASS: TestAccAWSLambdaEventSourceMapping_Kinesis_ParallelizationFactor (129.45s)
--- PASS: TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRecordAgeInSecondsNegativeOne (135.72s)
--- PASS: TestAccAWSLambdaEventSourceMapping_Kinesis_DestinationConfig (148.77s)
--- PASS: TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRetryAttemptsNegativeOne (174.03s)
--- PASS: TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRetryAttemptsZero (181.81s)
--- PASS: TestAccAWSLambdaEventSourceMapping_SQS_basic (183.65s)
--- PASS: TestAccAWSLambdaEventSourceMapping_SQS_changesInEnabledAreDetected (185.02s)
--- PASS: TestAccAWSLambdaEventSourceMapping_Kinesis_basic (190.09s)
=== CONT TestAccAWSLambdaEventSourceMapping_disappears
--- PASS: TestAccAWSLambdaEventSourceMapping_disappears (69.40s)
--- PASS: TestAccAWSLambdaEventSourceMapping_MSK (1916.28s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 1919.431s
GovCloud
% make testacc TEST=./aws TESTARGS='-run=TestAccAWSLambdaEventSourceMapping_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSLambdaEventSourceMapping_ -timeout 180m
=== RUN TestAccAWSLambdaEventSourceMapping_Kinesis_basic
=== PAUSE TestAccAWSLambdaEventSourceMapping_Kinesis_basic
=== RUN TestAccAWSLambdaEventSourceMapping_SQS_basic
=== PAUSE TestAccAWSLambdaEventSourceMapping_SQS_basic
=== RUN TestAccAWSLambdaEventSourceMapping_DynamoDB_basic
=== PAUSE TestAccAWSLambdaEventSourceMapping_DynamoDB_basic
=== RUN TestAccAWSLambdaEventSourceMapping_SQS_BatchWindow
=== PAUSE TestAccAWSLambdaEventSourceMapping_SQS_BatchWindow
=== RUN TestAccAWSLambdaEventSourceMapping_disappears
=== PAUSE TestAccAWSLambdaEventSourceMapping_disappears
=== RUN TestAccAWSLambdaEventSourceMapping_SQS_changesInEnabledAreDetected
=== PAUSE TestAccAWSLambdaEventSourceMapping_SQS_changesInEnabledAreDetected
=== RUN TestAccAWSLambdaEventSourceMapping_Kinesis_StartingPositionTimestamp
=== PAUSE TestAccAWSLambdaEventSourceMapping_Kinesis_StartingPositionTimestamp
=== RUN TestAccAWSLambdaEventSourceMapping_Kinesis_BatchWindow
=== PAUSE TestAccAWSLambdaEventSourceMapping_Kinesis_BatchWindow
=== RUN TestAccAWSLambdaEventSourceMapping_Kinesis_ParallelizationFactor
=== PAUSE TestAccAWSLambdaEventSourceMapping_Kinesis_ParallelizationFactor
=== RUN TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRetryAttempts
=== PAUSE TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRetryAttempts
=== RUN TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRetryAttemptsZero
=== PAUSE TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRetryAttemptsZero
=== RUN TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRetryAttemptsNegativeOne
=== PAUSE TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRetryAttemptsNegativeOne
=== RUN TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRecordAgeInSeconds
=== PAUSE TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRecordAgeInSeconds
=== RUN TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRecordAgeInSecondsNegativeOne
=== PAUSE TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRecordAgeInSecondsNegativeOne
=== RUN TestAccAWSLambdaEventSourceMapping_Kinesis_BisectBatch
=== PAUSE TestAccAWSLambdaEventSourceMapping_Kinesis_BisectBatch
=== RUN TestAccAWSLambdaEventSourceMapping_Kinesis_DestinationConfig
=== PAUSE TestAccAWSLambdaEventSourceMapping_Kinesis_DestinationConfig
=== RUN TestAccAWSLambdaEventSourceMapping_MSK
=== PAUSE TestAccAWSLambdaEventSourceMapping_MSK
=== CONT TestAccAWSLambdaEventSourceMapping_Kinesis_basic
=== CONT TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRetryAttempts
=== CONT TestAccAWSLambdaEventSourceMapping_SQS_changesInEnabledAreDetected
=== CONT TestAccAWSLambdaEventSourceMapping_Kinesis_BatchWindow
=== CONT TestAccAWSLambdaEventSourceMapping_disappears
=== CONT TestAccAWSLambdaEventSourceMapping_DynamoDB_basic
=== CONT TestAccAWSLambdaEventSourceMapping_Kinesis_BisectBatch
=== CONT TestAccAWSLambdaEventSourceMapping_Kinesis_ParallelizationFactor
=== CONT TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRetryAttemptsNegativeOne
=== CONT TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRecordAgeInSeconds
=== CONT TestAccAWSLambdaEventSourceMapping_SQS_BatchWindow
=== CONT TestAccAWSLambdaEventSourceMapping_Kinesis_StartingPositionTimestamp
=== CONT TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRecordAgeInSecondsNegativeOne
=== CONT TestAccAWSLambdaEventSourceMapping_Kinesis_DestinationConfig
=== CONT TestAccAWSLambdaEventSourceMapping_SQS_basic
=== CONT TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRetryAttemptsZero
=== CONT TestAccAWSLambdaEventSourceMapping_MSK
--- PASS: TestAccAWSLambdaEventSourceMapping_SQS_BatchWindow (66.56s)
--- PASS: TestAccAWSLambdaEventSourceMapping_DynamoDB_basic (75.94s)
--- PASS: TestAccAWSLambdaEventSourceMapping_Kinesis_DestinationConfig (103.19s)
--- PASS: TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRetryAttemptsNegativeOne (107.05s)
--- PASS: TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRecordAgeInSecondsNegativeOne (107.53s)
--- PASS: TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRetryAttemptsZero (108.26s)
--- PASS: TestAccAWSLambdaEventSourceMapping_SQS_changesInEnabledAreDetected (109.75s)
--- PASS: TestAccAWSLambdaEventSourceMapping_Kinesis_BatchWindow (120.81s)
--- PASS: TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRetryAttempts (126.59s)
--- PASS: TestAccAWSLambdaEventSourceMapping_Kinesis_ParallelizationFactor (139.70s)
--- PASS: TestAccAWSLambdaEventSourceMapping_Kinesis_StartingPositionTimestamp (142.33s)
--- PASS: TestAccAWSLambdaEventSourceMapping_Kinesis_BisectBatch (153.10s)
--- PASS: TestAccAWSLambdaEventSourceMapping_Kinesis_basic (159.54s)
--- PASS: TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRecordAgeInSeconds (165.74s)
--- PASS: TestAccAWSLambdaEventSourceMapping_SQS_basic (195.56s)
=== CONT TestAccAWSLambdaEventSourceMapping_disappears
--- PASS: TestAccAWSLambdaEventSourceMapping_disappears (69.40s)
=== CONT TestAccAWSLambdaEventSourceMapping_MSK
provider_test.go:1072: skipping test for aws-us-gov/us-gov-west-1: Error running apply: exit status 1
2021/05/07 17:16:06 [DEBUG] Using modified User-Agent: Terraform/0.12.30 HashiCorp-terraform-exec/0.13.3
Error: error creating Lambda Event Source Mapping (arn:aws-us-gov:kafka:us-gov-west-1:357342307427:cluster/tf-acc-test-1472047573752645107/47b7322b-9075-4009-8b91-c4975ee9edcb-3): InvalidParameterValueException: Unsupported source arn : arn:aws-us-gov:kafka:us-gov-west-1:357342307427:cluster/tf-acc-test-1472047573752645107/47b7322b-9075-4009-8b91-c4975ee9edcb-3
{
RespMetadata: {
StatusCode: 400,
RequestID: "713c2b4b-dc9e-47df-b3f3-9009b92bcdfd"
},
Message_: "Unsupported source arn : arn:aws-us-gov:kafka:us-gov-west-1:357342307427:cluster/tf-acc-test-1472047573752645107/47b7322b-9075-4009-8b91-c4975ee9edcb-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" {
--- SKIP: TestAccAWSLambdaEventSourceMapping_MSK (1435.60s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 1438.674s
This has been released in version 3.40.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. |
Description
After importing event source mapping resources, TF tries to replace the resource on next apply. Seems this is expected behaviour, according to official aws_lambda_event_source_mapping documentation.
Checking for a more recent GetEventSourceMapping API docs though, seems like
starting_position
andstarting_position_timestamp
are now exposed on that API. (Don't know when the change was done on AWS side, but docs were updated on March 19th)This PR adds support for TF to read fields
starting_position
andstarting_position_timestamp
; which in turn should avoid a recreation after import.Community Note
Relates #1133
Output from acceptance testing: