SDK version
github.com/hashicorp/terraform-plugin-sdk/v2 v2.38.1
Expected Behavior
Create operation fails with expected error.
Actual Behavior
Create operation fails with expected error and Missing Resource Identity After Create: The Terraform provider unexpectedly returned no resource identity after having no errors in the resource error.
Steps to Reproduce
In resource code, set id in create that fails. (This allows a tainted resource to be saved in state to allow cleanup in a future apply)
If there is no state, the conditional at
|
if destroy || newInstanceState == nil || newInstanceState.Attributes == nil || newInstanceState.ID == "" { |
exits without checking for Resource Identity.
However, if id is set, the return is skipped and it continues on the the Resource Identity checks at
.
See, for example: hashicorp/terraform-provider-aws#45351
SDK version
Expected Behavior
Create operation fails with expected error.
Actual Behavior
Create operation fails with expected error and
Missing Resource Identity After Create: The Terraform provider unexpectedly returned no resource identity after having no errors in the resourceerror.Steps to Reproduce
In resource code, set
idin create that fails. (This allows a tainted resource to be saved in state to allow cleanup in a futureapply)If there is no state, the conditional at
terraform-plugin-sdk/helper/schema/grpc_provider.go
Line 1507 in 8bd650e
However, if
idis set, the return is skipped and it continues on the the Resource Identity checks atterraform-plugin-sdk/helper/schema/grpc_provider.go
Line 1549 in 8bd650e
See, for example: hashicorp/terraform-provider-aws#45351