How to add Addons to EKS with Pulumi

24 views Asked by At

I'm creating an EKS cluster with Pulumi Crosswalk:

                // vpc creation skipped
        cluster, err := eks.NewCluster(ctx, ClusterName, &eks.ClusterArgs{
            Name:                         pulumi.String(ClusterName),
            VpcId:                        vpc.VpcId,
            PublicSubnetIds:              vpc.PublicSubnetIds,
            PrivateSubnetIds:             vpc.PrivateSubnetIds,
            NodeAssociatePublicIpAddress: pulumi.BoolRef(false),
            CreateOidcProvider:           pulumi.BoolPtr(true),
        })
        if err != nil {
            return err
        }

this works as expected. Now I want to add some EKS addons:

        _, err = peks.NewAddon(ctx, "csiEbsAddon", &peks.AddonArgs{
            ClusterName: cluster.Core.ApplyT(
                func(core eks.CoreData) pulumi.StringOutput {
                    return core.Cluster.Name
                },
            ).(pulumi.StringOutput),
            AddonName: pulumi.String("aws-ebs-csi-driver"),
        })

this doesn't work, and I don't understand the error nor what I am doing wrong:

Error:

Diagnostics:
  pulumi:pulumi:Stack (infrastructure-dev):
    error: an unhandled error occurred: program failed:
    waiting for RPCs: marshaling properties: awaiting input property "clusterName": expected a eks.Cluster, got a resource of type eks.Cluster

any help appreciated!

0

There are 0 answers