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

best-xylophone-83824

08/06/2019, 6:54 PM
@bitter-oil-46081, in https://github.com/pulumi/pulumi/issues/2788 you write
2: For previews and updates where we also plan to run user code, we as the language host if it knows of any plugins that may be needed. Only NodeJS >implements this today, and does so by walking all the package.json's and looking for pulumi specific metadata.
For (2), we now support the language host to communicate an optional server.
how can I change, if possible, package.json so that
pulumi plugin install
pulls plugins from a custom --server?
b

bitter-oil-46081

08/06/2019, 6:59 PM
I think what you are asking is "what metadata can I add to my package.json file" such that when
pulumi plugin install
is run, it will use a custom server for downloading my plugin. Unfortunately, I don't think there's a way to do that today. A workaround would be to use the
install
section of
package.json
to have npm run
pulumi plugin install --server ...
when the package itself is installed.
Welp, I was wrong in my memory. I think this is actually supported today 🙂
Inside your
package.json
add the following:
Copy code
pulumi: {
    resource: true,
    server: "<whatever you want passed to --server>"
}
I believe that should work.
b

best-xylophone-83824

08/06/2019, 7:03 PM
let me try
no, still ignored 😞 git diff:
Copy code
--- a/package.json
+++ b/package.json
@@ -7,4 +7,8 @@
         "@pulumi/pulumi": "latest",
         "@pulumi/gcp": "latest"
+    },
+    "pulumi": {
+      "resource": true,
+      "server": "<https://cachingproxy.mycorp/api.pulumi.com/>"
     }
 }
run :
Copy code
[resource plugin gcp-0.18.13] installing
[resource plugin gcp-0.18.13] downloading from 
error: [resource plugin gcp-0.18.13] downloading from : Get <https://api.pulumi.com/releases/plugins/pulumi-resource-gcp-v0.18.13-linux-amd64.tar.gz>: dial tcp 54.213.182.12:443: connect: connection refused
empty
downloading from
suggests that
serverURL
is empty at that point 😞
b

bitter-oil-46081

08/06/2019, 9:01 PM
Just so I understand, @best-xylophone-83824, you are trying to force all plugins to be be downloaded from your internal caching server (i.e. you want to force that we pull the gcp plugin published by us at Pulumi to go through your server) or are you trying to publish a new resource provider you've created yourself?
b

best-xylophone-83824

08/07/2019, 9:31 AM
former. Workaround I am trying now is to parse lock file and reconstruct arguments for
pulumi plugin install  resource gcp $ver --server
2 Views