https://pulumi.com logo
Title
s

stale-answer-81646

11/21/2022, 10:14 PM
Hello everyone 😄 Not sure if this is the right place for this but following some of the python examples on this documentation, many seem to be outdated Specifically, when creating a cluster object it is assumed that the k8s provider can be accessed through ‘cluster.provider’ Unfortunately, the provider attribute does not exist on a cluster object:
error: Program failed with an unhandled exception:
    Traceback (most recent call last):
      File "./__main__.py", line 34, in <module>
        opts=pulumi.ResourceOptions(provider=cluster.provider),
    AttributeError: 'Cluster' object has no attribute 'provider'
What is the best way to work around this issue?
My current approach is to manually construct the provider, but i’m wondering if there’s a better approach 🙂
cluster_provider = pulumi_kubernetes.Provider("cluster_provider", kubeconfig=cluster.kubeconfig)