brash-quill-35776
08/10/2021, 3:57 AMClusterProvider
from pipeline A and use it in pipeline B.
When I do so, I am able to see the ClusterProvider
in pipeline B properly but, since it is of type Output<Provider>
, I can't use it as a provider for k8s Namespace resource
const reference = new pulumi.StackReference("A-dev");
const clusterProvider = reference.requireOutput("clusterProvider").get();
const ns = new k8s.core.v1.Namespace("cluster", {
}, { provider: clusterProvider });
// getting error when pulumi up
Error: Cannot call '.get' during update or preview.
To manipulate the value of this Output, use '.apply' instead.
at Proxy.get (/Users/u6105440/Workspace/tr/Stratus/a207937_stratus-namespace/node_modules/@pulumi/pulumi/output.js:173:15)
at Object.<anonymous> (/Users/u6105440/Workspace/tr/Stratus/a207937_stratus-namespace/src/config.ts:7:75)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Module.m._compile (/Users/u6105440/Workspace/tr/Stratus/a207937_stratus-namespace/node_modules/ts-node/src/index.ts:439:23)
at Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Object.require.extensions.<computed> [as .ts] (/Users/u6105440/Workspace/tr/Stratus/a207937_stratus-namespace/node_modules/ts-node/src/index.ts:442:12)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:94:18)
I understand that the provider
property is not Input that blocks it from accepting the Output<Provider>
, and using get()
or apply()
will also having issues.
In this case, how do I get it around? I need this ClusterProvider
to use as k8s provider for the following resourcesbillowy-army-68599
08/10/2021, 3:59 AMget
property at the end there, I thinkbrash-quill-35776
08/10/2021, 4:00 AMget
which gives me of Output
, this can't be passed to the provider
property because provider
is not Input
typebored-oyster-3147
08/10/2021, 11:12 AMbrash-quill-35776
08/10/2021, 2:10 PMprovider
thing to achieve that?K8s.Provider
object, which totally makes sense as this is how I use it in project A anyway.
1. endpoint
2. masteAuth
3. cluster name
Since the StackReference
provide access to output value, I was thinking of accessing the ClusterProvider
object directly instead of constructing it the same way I did in project A.
Are you saying that it is not possible to directly reference an output from StackReference?bored-oyster-3147
08/10/2021, 2:21 PMbrash-quill-35776
08/10/2021, 2:27 PMbored-oyster-3147
08/10/2021, 2:29 PMbrash-quill-35776
08/10/2021, 2:48 PM