Did it work before you added addon.ts? Those TS e...
# general
c
Did it work before you added addon.ts? Those TS errors are from index it looks like. Can you paste the relevant addon.ts code?
a
Hi Baz, Thanks for your reply please find the code
Copy code
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const VPC_CNI = new aws.eks.Addon("VPC_CNI", {
    clusterName: kubectl get .${env},
    addonName: "vpc-cni",
});

const COREDNS = new aws.eks.Addon("coredns", {
    clusterName: aws_eks_cluster.${env},
    addonName: "coredns",
    addonVersion: "v1.8.7-eksbuild.3",
    resolveConflicts: "PRESERVE",
});

const kube_proxy = new aws.eks.Addon("kube_proxy", {
    clusterName: aws_eks_cluster.${env},
    addonName: "kube-proxy",
    addonVersion: "v1.21.12-eksbuild.2",
    resolveConflicts: "PRESERVE",
});

export class Addon extends pulumi.CustomResource {

    public static get(name: string, id: pulumi.Input<pulumi.ID>, state: AddonState, opts: pulumi.CustomResourceOptions): Addon {
        return new Addon(vpc-cni, <any>state, { ...opts, id: id });
    }

    public static get(name: string, id: pulumi.Input<pulumi.ID>, state: AddonState, opts: pulumi.CustomResourceOptions): Addon {
        return new Addon(coredns, <any>state, { ...opts, id: id });
    }

    public static get(name: string, id: pulumi.Input<pulumi.ID>, state: AddonState, opts: pulumi.CustomResourceOptions): Addon {
        return new Addon(kube-proxy, <any>state, { ...opts, id: id });
    }


    public static readonly __pulumiType = 'aws:eks/addon:Addon';

    public static isInstance(obj: any): obj is Addon {
        if (obj === undefined || obj === null) {
            return false;
        }
        return obj['__pulumiType'] === Addon.__pulumiType;
    }   
}
function constructor(name: void, string: any, args: any, AddonArgs: any, arg4: any) {
    throw new Error("Function not implemented.");
}
c
Copy code
import * as aws from "@pulumi/aws";
import { clusterName } from "./config.ts";
import { awsProvider as provider } from "./provider.ts";

export const vpcCni = new aws.eks.Addon("VPC_CNI", {
    clusterName,
    addonName: "vpc-cni",
}, { provider });

export const coireDns = new aws.eks.Addon("coredns", {
    clusterName,
    addonName: "coredns",
    addonVersion: "v1.8.7-eksbuild.3",
    resolveConflicts: "PRESERVE",
}, { provider });

export const kubeProxy = new aws.eks.Addon("kube_proxy", {
    clusterName,
    addonName: "kube-proxy",
    addonVersion: "v1.21.12-eksbuild.2",
    resolveConflicts: "PRESERVE",
}, { provider });
I'd try something like this, where you define your cluster name and provider in appropriate files, then import them here. You don't appear to be doing anything w/ that custom resource so I'd just leave it out. hope this helps!
a
Thanks @cuddly-computer-18851 will try it out and keep you posted.