You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During import, Terraform should report "Import prepared" (or something similar) after the resource importer State() function is complete.
To be extra clear, after both the State() and Read() functions complete successfully, a message announcing "Import complete!" could be given.
Actual Behavior
During import, Terraform wrongly reports "Import complete!" when it is not usually complete.
Terraform reports "Import complete!" after the resource importer State() function is complete. However, State() is often used to just set enough information so that Read() works, which is called immediately after. Usually during State(), information provided in the import command is put in the right places in the state, without ever checking anything on AWS (or presumably, other provider). That does not constitute the normal meaning of "import complete." As a result, it's easy to get the confusing and wrong "Import complete!" message below followed by a "non-existent resource" message.
aws_route.test: Importing from ID "rtb-0b8835dc7eb1e3168_12.22.48.96/0"...
aws_route.test: Import complete!
Imported aws_route (ID: r-rtb-0b8835dc7eb1e3168715786107)
aws_route.test: Refreshing state... (ID: r-rtb-0b8835dc7eb1e3168715786107)
Error: aws_route.test (import id: rtb-0b8835dc7eb1e3168_12.22.48.96/0): 1 error(s) occurred:
* import aws_route.test result: r-rtb-0b8835dc7eb1e3168715786107: import aws_route.test (id: r-rtb-0b8835dc7eb1e3168715786107): Terraform detected a resource with this ID doesn't
exist. Please verify the ID is correct. You cannot import non-existent
resources using Terraform import.
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
ghost
locked and limited conversation to collaborators
Aug 13, 2019
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Terraform Version
Terraform Configuration Files
Expected Behavior
During import, Terraform should report "Import prepared" (or something similar) after the resource importer
State()
function is complete.To be extra clear, after both the
State()
andRead()
functions complete successfully, a message announcing "Import complete!" could be given.Actual Behavior
During import, Terraform wrongly reports "Import complete!" when it is not usually complete.
Terraform reports "Import complete!" after the resource importer
State()
function is complete. However,State()
is often used to just set enough information so thatRead()
works, which is called immediately after. Usually duringState()
, information provided in the import command is put in the right places in the state, without ever checking anything on AWS (or presumably, other provider). That does not constitute the normal meaning of "import complete." As a result, it's easy to get the confusing and wrong "Import complete!" message below followed by a "non-existent resource" message.Steps to Reproduce
terraform init
terraform apply
terraform state rm aws_route.test
terraform import -input=false aws_route.test rtb-0b8835dc7eb1e3168_12.22.48.96/0
Additional Context
References
The text was updated successfully, but these errors were encountered: