This message was deleted.
# general
s
This message was deleted.
b
I just built my own
b
it looks like we don't have a good example of this, which is surprising! The EKS API returns outputs that you can use to construct the kubeconfig manually, here's that example in Go: https://github.com/pulumi/examples/blob/master/aws-go-eks/main.go#L226-L260 Essentially you'll need to take the
endpoint
and
certificateAuthority
outputs and place them in a json string manually
b
Copy code
cluster = aws.eks.Cluster(...)
        
        kubeconfig = pulumi.Output.all(cluster.endpoint, cluster.certificate_authority["data"], cluster.name).apply(lambda vars: inspect.cleandoc(f"""
            apiVersion: v1
            clusters:
            - cluster:
                server: {vars[0]}
                certificate-authority-data: {vars[1]}
              name: kubernetes
            contexts:
            - context:
                cluster: kubernetes
                user: aws
              name: aws
            current-context: aws
            kind: Config
            preferences: {{}}
            users:
            - name: aws
              user:
                exec:
                  apiVersion: <http://client.authentication.k8s.io/v1alpha1|client.authentication.k8s.io/v1alpha1>
                  command: aws
                  args:
                    - eks
                    - get-token
                    - --cluster-name
                    - {vars[2]}
                    - --role
                    - {self.assume_role}
        """))
Hopefully this will help you
m
I see, thank you both! I’ll try it out and see if it works 👍
w00t, this seems to have worked! (well, at least the pulumi update succeeded this time) thanks for the help!