-
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
r/aws_lambda_invocation: add state upgrader for pre-v5.1.0 upgrades #40958
Conversation
Community NoteVoting for Prioritization
For Submitters
|
9af6a51
to
93fe2a3
Compare
This state upgrader will prevent unintended invocations when upgrading a pre-`v5.1.0` version of the `aws_lambda_invocation` resource to the latest version of the provider. Because we cannot retroactively apply this state upgrader to versions `v5.1.0`-`v5.83.0`, those versions will continue to see a single errant invocation when the configuration does not change but the version is upgraded to one in the impacted series. Upgrades to `v5.84.0` (the version in which this fix is applied) and above should properly upgrade the state and prevent any unintended invocations from occurring. This fix will also prevent issues upgrading a pre-`v5.1.0` version of the `aws_lambda_invocation` resource with `inputs` that cannot be marshaled into a `map[string]interface{}` (e.g. an array). ```console % make testacc PKG=lambda TESTS=TestAccLambdaInvocation_UpgradeState_ make: Verifying source code with gofmt... ==> Checking that code complies with gofmt requirements... TF_ACC=1 go1.23.3 test ./internal/service/lambda/... -v -count 1 -parallel 20 -run='TestAccLambdaInvocation_UpgradeState_' -timeout 360m -vet=off 2025/01/15 16:13:42 Initializing Terraform AWS Provider... --- PASS: TestAccLambdaInvocation_UpgradeState_Pre_v5_1_0 (45.26s) --- PASS: TestAccLambdaInvocation_UpgradeState_v5_83_0 (53.68s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/lambda 60.107s ``` ```console % make testacc PKG=lambda TESTS=TestAccLambdaInvocation_ make: Verifying source code with gofmt... ==> Checking that code complies with gofmt requirements... TF_ACC=1 go1.23.3 test ./internal/service/lambda/... -v -count 1 -parallel 20 -run='TestAccLambdaInvocation_' -timeout 360m -vet=off 2025/01/15 16:31:09 Initializing Terraform AWS Provider... --- PASS: TestAccLambdaInvocation_lifecycle_scopeCreateOnlyUpdateInput (38.50s) --- PASS: TestAccLambdaInvocation_UpgradeState_Pre_v5_1_0 (47.29s) --- PASS: TestAccLambdaInvocation_lifecycle_scopeCRUDCreate (48.96s) --- PASS: TestAccLambdaInvocation_lifecycle_scopeCRUDDestroy (52.95s) --- PASS: TestAccLambdaInvocation_qualifier (55.09s) --- PASS: TestAccLambdaInvocation_UpgradeState_v5_83_0 (55.16s) --- PASS: TestAccLambdaInvocation_triggers (58.94s) --- PASS: TestAccLambdaInvocation_basic (60.94s) --- PASS: TestAccLambdaInvocation_complex (73.41s) --- PASS: TestAccLambdaInvocation_lifecycle_scopeCreateOnlyToCRUD (76.03s) --- PASS: TestAccLambdaInvocation_terraformKey (79.90s) --- PASS: TestAccLambdaInvocation_lifecycle_scopeCRUDUpdateInput (98.94s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/lambda 105.431s ```
93fe2a3
to
9e848c0
Compare
Co-authored-by: Kit Ewbank <[email protected]>
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=TestAccLambdaInvocation_' PKG=lambda ACCTEST_PARALLELISM=3
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.3 test ./internal/service/lambda/... -v -count 1 -parallel 3 -run=TestAccLambdaInvocation_ -timeout 360m -vet=off
2025/01/16 10:33:49 Initializing Terraform AWS Provider...
=== RUN TestAccLambdaInvocation_basic
=== PAUSE TestAccLambdaInvocation_basic
=== RUN TestAccLambdaInvocation_qualifier
=== PAUSE TestAccLambdaInvocation_qualifier
=== RUN TestAccLambdaInvocation_complex
=== PAUSE TestAccLambdaInvocation_complex
=== RUN TestAccLambdaInvocation_triggers
=== PAUSE TestAccLambdaInvocation_triggers
=== RUN TestAccLambdaInvocation_lifecycle_scopeCRUDCreate
=== PAUSE TestAccLambdaInvocation_lifecycle_scopeCRUDCreate
=== RUN TestAccLambdaInvocation_lifecycle_scopeCRUDUpdateInput
=== PAUSE TestAccLambdaInvocation_lifecycle_scopeCRUDUpdateInput
=== RUN TestAccLambdaInvocation_lifecycle_scopeCreateOnlyUpdateInput
=== PAUSE TestAccLambdaInvocation_lifecycle_scopeCreateOnlyUpdateInput
=== RUN TestAccLambdaInvocation_lifecycle_scopeCRUDDestroy
=== PAUSE TestAccLambdaInvocation_lifecycle_scopeCRUDDestroy
=== RUN TestAccLambdaInvocation_lifecycle_scopeCreateOnlyToCRUD
=== PAUSE TestAccLambdaInvocation_lifecycle_scopeCreateOnlyToCRUD
=== RUN TestAccLambdaInvocation_terraformKey
=== PAUSE TestAccLambdaInvocation_terraformKey
=== RUN TestAccLambdaInvocation_UpgradeState_Pre_v5_1_0
=== PAUSE TestAccLambdaInvocation_UpgradeState_Pre_v5_1_0
=== RUN TestAccLambdaInvocation_UpgradeState_v5_83_0
=== PAUSE TestAccLambdaInvocation_UpgradeState_v5_83_0
=== CONT TestAccLambdaInvocation_basic
=== CONT TestAccLambdaInvocation_lifecycle_scopeCreateOnlyUpdateInput
=== CONT TestAccLambdaInvocation_triggers
--- PASS: TestAccLambdaInvocation_lifecycle_scopeCreateOnlyUpdateInput (37.42s)
=== CONT TestAccLambdaInvocation_complex
--- PASS: TestAccLambdaInvocation_basic (38.58s)
=== CONT TestAccLambdaInvocation_lifecycle_scopeCRUDUpdateInput
--- PASS: TestAccLambdaInvocation_complex (25.51s)
=== CONT TestAccLambdaInvocation_lifecycle_scopeCRUDCreate
--- PASS: TestAccLambdaInvocation_triggers (64.67s)
=== CONT TestAccLambdaInvocation_terraformKey
--- PASS: TestAccLambdaInvocation_lifecycle_scopeCRUDUpdateInput (48.37s)
=== CONT TestAccLambdaInvocation_UpgradeState_v5_83_0
--- PASS: TestAccLambdaInvocation_terraformKey (26.49s)
=== CONT TestAccLambdaInvocation_UpgradeState_Pre_v5_1_0
--- PASS: TestAccLambdaInvocation_lifecycle_scopeCRUDCreate (37.31s)
=== CONT TestAccLambdaInvocation_qualifier
--- PASS: TestAccLambdaInvocation_qualifier (27.68s)
=== CONT TestAccLambdaInvocation_lifecycle_scopeCreateOnlyToCRUD
--- PASS: TestAccLambdaInvocation_UpgradeState_Pre_v5_1_0 (62.88s)
=== CONT TestAccLambdaInvocation_lifecycle_scopeCRUDDestroy
--- PASS: TestAccLambdaInvocation_UpgradeState_v5_83_0 (68.18s)
--- PASS: TestAccLambdaInvocation_lifecycle_scopeCreateOnlyToCRUD (33.86s)
--- PASS: TestAccLambdaInvocation_lifecycle_scopeCRUDDestroy (36.31s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/lambda 195.659s
This functionality has been released in v5.84.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! |
Description
This state upgrader will prevent unintended invocations when upgrading a pre-
v5.1.0
version of theaws_lambda_invocation
resource to the latest version of the provider. Because we cannot retroactively apply this state upgrader to versionsv5.1.0
-v5.83.0
, those versions will continue to see a single errant invocation when theinput
does not change but the version is upgraded to one in the impacted series. Upgrades tov5.84.0
(the version in which this fix is applied) and above should properly upgrade the state and prevent any unintended invocations from occurring.This fix will also prevent issues upgrading a pre-
v5.1.0
version of theaws_lambda_invocation
resource withinputs
that cannot be marshaled into amap[string]interface{}
(e.g. an array).Relations
Closes #40954
Closes #31786
Relates #29367
Output from Acceptance Testing