Skip to content

postgresql_server import by "serverName" does not resolve to resource id #590

@ptimlum

Description

@ptimlum

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

Originally posted by @cyrilgdn in #329

as the OP for #329 stated import attempts result in
Error: Cannot import non-existent remote object

along with the logging statement
[WARN] PostgreSQL foreign server () not found

for imports, serverName seem to be an empty string here:

serverName := d.Get(serverNameAttr).(string)

something like this instead seems to allow imports correctly
serverName := d.Id()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions