https://pulumi.com logo
#python
Title
# python
b

broad-crowd-47299

01/29/2024, 6:55 PM
Trying to copy a file from my pulumi machine to a remote server and this is the code snippet related to the operation:
Copy code
copy = command.remote.CopyFile(f"copyFile",
    connection=command.remote.ConnectionArgs(
        host=remote_server,
        port=22,
        user=remote_user,
        password=remote_password
    ),
    local_path=f"{os.path.abspath(os.path.dirname(__file__))}/cfg_files/nginx.conf",
    remote_path=f"~/wp-nginx-{current_stack}.conf"
)
pulumi.export("copied-file", copy.id)
But whenever I run the stack it fails with this message:
└─ command:remote:CopyFile   copyFile                 **creating failed**     1 error
Diagnostics:
command:remote:CopyFile (copyFile):
error: file does not exist
Local file is there, so I don't understand to what the "file does not exist" error is referring to. Any suggestion ??
Found it ... it can't resolve the ~