https://pulumi.com logo
Title
j

jolly-church-88521

04/25/2022, 3:31 PM
Is the example of
aws-go-eks
working fine? Iā€™m trying to create cluster and Iā€™m getting some errors:
Diagnostics:
  pulumi:pulumi:Stack (aws-go-eks-dev):
    error: an unhandled error occurred: program exited with non-zero exit code: 2

    # aws-go-eks
    ./main.go:144:15: eksCluster.CertificateAuthority undefined (type *eks.Cluster has no field or method CertificateAuthority)
    ./main.go:148:16: eksCluster.CertificateAuthority undefined (type *eks.Cluster has no field or method CertificateAuthority)
Shall it be:
pulumi.StringOutput(eksCluster.CertificateAuthorities)
instead?
diff --git a/aws-go-eks/main.go b/aws-go-eks/main.go
index 96c880f..ed15fc0 100644
--- a/aws-go-eks/main.go
+++ b/aws-go-eks/main.go
@@ -140,12 +140,11 @@ func main() {
                        return err
                }

-               ctx.Export("kubeconfig", generateKubeconfig(eksCluster.Endpoint,
-                       eksCluster.CertificateAuthority.Data().Elem(), eksCluster.Name))
+               ctx.Export("kubeconfig", generateKubeconfig(eksCluster.Endpoint, pulumi.StringOutput(eksCluster.CertificateAuthorities), eksCluster.Name))

                k8sProvider, err := providers.NewProvider(ctx, "k8sprovider", &providers.ProviderArgs{
                        Kubeconfig: generateKubeconfig(eksCluster.Endpoint,
-                               eksCluster.CertificateAuthority.Data().Elem(), eksCluster.Name),
+                               pulumi.StringOutput(eksCluster.CertificateAuthorities), eksCluster.Name),
                }, pulumi.DependsOn([]pulumi.Resource{nodeGroup}))
                if err != nil {
                        return err
Ok - now it works šŸ™‚ Shall I create a PR?
b

billowy-army-68599

04/25/2022, 3:54 PM
yes please!
šŸ‘ 1
j

jolly-church-88521

04/25/2022, 4:06 PM
And my first PR for pulumi: https://github.com/pulumi/examples/pull/1208 šŸ˜‰