Running a terraform import with a stack ID that doesn't exist results in an obscure error message from Terraform:
terraform import spacelift_stack.this non-existent-stack
spacelift_stack.this: Importing from ID "non-existent-stack"...
╷
│ Error: The provider returned a resource missing an identifier during ImportResourceState. This is generally a bug in the resource implementation for import. Resource import code should not call d.SetId("") or create an empty ResourceData. If the resource is missing, instead return an error. Please report this to the provider developers.
This is caused by us setting the ID to an empty string and not returning an error if the stack doesn't exist. We can detect this and give users a better error message.
Running a terraform import with a stack ID that doesn't exist results in an obscure error message from Terraform:
This is caused by us setting the ID to an empty string and not returning an error if the stack doesn't exist. We can detect this and give users a better error message.