Closed cyn-rus closed 4 months ago
I've just stumbled upon a similar issue. @cyn-rus, did you manage to figure out how the ID is formed? ~It seems it's not that straightforward and might be something like database_name.server_name
or fdw_name.server_name
(though I tried these, and they didn't work either).~
I've created a new postgresql_server and the id seems to be equal to its name 🤔
Ok, a workaround I've applied is creating a new resource (with a new name, but similar params), and then editing the state file to match the name and id with the existing resource. After that I deleted the newly created resource, edited the terragrunt.hcl
to have correct resource naming and tg plan
now suggests no changes.
Though a working import functionality would be very much appreciated!
Hi @lancedikson @cyn-rus ,
You cannot import by name
directly for the server?
terraform import postgresql_server.warehouse_server server
For the user mapping it should be with:
terraform import postgresql_user_mapping.warehouse_server_dashboard dashboard.server
I'll add this to the documentation, meanwhile I close this issue but don't hesitate to open it back if the import doesn't work
Unfortunately importing via name doesn't seem to work. I get the dreaded Error: Cannot import non-existent remote object
.
Terraform Version
1.5.2
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
Resources imported successfully
Actual Behavior
Resources are unable to be imported with message
Error: Cannot import non-existent remote object
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
Important Factoids
New functions needed for importing