trying to follow this example on the docs page, bu...
# general
trying to follow this example on the docs page, but it’s not working:
Copy code
import * as k8s from "@pulumi/kubernetes";
import * as pulumi from "@pulumi/pulumi";
const env = pulumi.getStack();
const infra = new pulumi.StackReference(`acmecorp/infra/${env}`);
const provider = new k8s.Provider("k8s", { kubeconfig: infra.getOutput("kubeConfig") });
const service = new k8s.core.v1.Service(..., { provider: provider });
when I do this, it says
Copy code
pulumi:providers:kubernetes (k8s):
    error: pulumi:providers:kubernetes resource 'k8s's property 'kubeconfig' value {map[apiVersion:{v1} .... {aws-iam-authenticator}]}]}]}]}]} has a problem: provider property values must be strings
i’ve tried using .apply(), JSON.stringify, <string> etc
if I copy and paste the contents of the kubeconfig file as a string instead of using the output, it works
Try this:
Copy code
const kubeconfig = infraStack.getOutput("kubeConfig").apply(JSON.stringify);
i still have the hardest time in this particular nook of pulumi
awesome that does work thank you