[Bug]: aws_lambda_invocation plan fails for deferred input values in CRUD lifecycle mode #32118
Labels
bug
Addresses a defect in current functionality.
service/lambda
Issues and PRs that pertain to the lambda service.
Milestone
Terraform Core Version
1.5.0
AWS Provider Version
5.1.0, 5.4.0 (latest at time of writing)
Affected Resource(s)
Expected Behavior
The following configuration can be successfully planned and applied:
can be successfully planned and applied:
Actual Behavior
The Terraform configuration fails to be planned.
Relevant Error/Panic Output Snippet
Terraform Configuration Files
Steps to Reproduce
Debug Output
See above.
Panic Output
No response
Important Factoids
1. Only affects deferred
input
valuesThis bug seems to only affect configurations where the
input
argument is deferred (terminology?), i.e. where a plan would normally show(known after apply)
.In the example above, the value of
time_static.arbitrary.rfc3339
at plan-time is(known after apply)
.Conversely, the following static value will plan and apply correctly:
Even local references will plan and apply correctly:
2. String transformations do not affect the result
Using
jsonencode()
for theinput
value, compared to a raw JSON string, makes no difference.3. Only affects CRUD lifecycle mode
Using
lifecycle_scope = "CREATE_ONLY"
(whether explicitly declared or by default) works correctly.References
Possibly related to the
customizeDiffValidateInput()
function here: https://github.com/hashicorp/terraform-provider-aws/blob/main/internal/service/lambda/diff.go#L17-L21 (introduced via #29367).Would you like to implement a fix?
Yes (however, seeing as the
customizeDiffValidateInput()
function seems like an intentional / design decision, I would appreciate some guidance first!)The text was updated successfully, but these errors were encountered: