— I’m trying to add a new EKS node group to an ex...
# golang
d
— I’m trying to add a new EKS node group to an exisisting eks cluster
Copy code
package main

import (
	"<http://github.com/pulumi/pulumi-aws/sdk/v5/go/aws/iam|github.com/pulumi/pulumi-aws/sdk/v5/go/aws/iam>"
	"<http://github.com/pulumi/pulumi-aws/sdk/v6/go/aws/eks|github.com/pulumi/pulumi-aws/sdk/v6/go/aws/eks>"
	meks "<http://github.com/pulumi/pulumi-eks/sdk/go/eks|github.com/pulumi/pulumi-eks/sdk/go/eks>"
	"<http://github.com/pulumi/pulumi/sdk/v3/go/pulumi|github.com/pulumi/pulumi/sdk/v3/go/pulumi>"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		// Create an EKS cluster with the default configuration.
		id := pulumi.ID("ops-cluster-node-groups-profile")
		profile, err := iam.GetInstanceProfile(ctx, "profile", id, nil)
		if err != nil {
			return err
		}

		ops, err := eks.GetCluster(ctx, "ops", pulumi.ID("ops"), nil)
		if err != nil {
			return err
		}

		_, err = meks.NewNodeGroupV2(ctx, "ops-cluster-node-groups", &meks.NodeGroupV2Args{
			AmiId:           pulumi.String("ami-xxxxxx"),
			Cluster:         ops,
			DesiredCapacity: <http://pulumi.Int|pulumi.Int>(2),
			InstanceProfile: profile,
			InstanceType:    pulumi.String("t3.xlarge"),
			MaxSize:         <http://pulumi.Int|pulumi.Int>(2),
			MinSize:         <http://pulumi.Int|pulumi.Int>(1),
			NodeSubnetIds:   pulumi.StringArray{pulumi.String("subnet-xxxxxxx")},
		})
		if err != nil {
			return err
		}

		return nil
	})
}
but I’m getting this error
Copy code
pulumi:pulumi:Stack (quickstart-test):
    error: eks:index:NodeGroupV2 resource 'ops-cluster-node-groups' has a problem: invocation of pulumi:pulumi:getResource returned an error: unknown resource urn:pulumi:test::quickstart::aws:iam/instanceProfile:InstanceProfile::profile
    error: Error: invocation of pulumi:pulumi:getResource returned an error: unknown resource urn:pulumi:test::quickstart::aws:iam/instanceProfile:InstanceProfile::profile
        at Object.callback (/snapshot/eks/node_modules/@pulumi/pulumi/runtime/resource.js:100:36)
        at Object.onReceiveStatus (/snapshot/eks/node_modules/@grpc/grpc-js/src/client.ts:360:26)
        at Object.onReceiveStatus (/snapshot/eks/node_modules/@grpc/grpc-js/src/client-interceptors.ts:458:34)
        at Object.onReceiveStatus (/snapshot/eks/node_modules/@grpc/grpc-js/src/client-interceptors.ts:419:48)
        at /snapshot/eks/node_modules/@grpc/grpc-js/src/resolving-call.ts:163:24
        at processTicksAndRejections (node:internal/process/task_queues:77:11)
    error: Error: invocation of pulumi:pulumi:getResource returned an error: unknown resource urn:pulumi:test::quickstart::aws:eks/cluster:Cluster::ops
        at Object.callback (/snapshot/eks/node_modules/@pulumi/pulumi/runtime/resource.js:100:36)
        at Object.onReceiveStatus (/snapshot/eks/node_modules/@grpc/grpc-js/src/client.ts:360:26)
        at Object.onReceiveStatus (/snapshot/eks/node_modules/@grpc/grpc-js/src/client-interceptors.ts:458:34)
        at Object.onReceiveStatus (/snapshot/eks/node_modules/@grpc/grpc-js/src/client-interceptors.ts:419:48)
        at /snapshot/eks/node_modules/@grpc/grpc-js/src/resolving-call.ts:163:24
        at processTicksAndRejections (node:internal/process/task_queues:77:11)

    Error: invocation of pulumi:pulumi:getResource returned an error: unknown resource urn:pulumi:test::quickstart::aws:eks/cluster:Cluster::ops: Error: invocation of pulumi:pulumi:getResource returned an error: unknown resource urn:pulumi:test::quickstart::aws:eks/cluster:Cluster::ops
        at Object.callback (/snapshot/eks/node_modules/@pulumi/pulumi/runtime/resource.js:100:36)
        at Object.onReceiveStatus (/snapshot/eks/node_modules/@grpc/grpc-js/src/client.ts:360:26)
        at Object.onReceiveStatus (/snapshot/eks/node_modules/@grpc/grpc-js/src/client-interceptors.ts:458:34)
        at Object.onReceiveStatus (/snapshot/eks/node_modules/@grpc/grpc-js/src/client-interceptors.ts:419:48)
        at /snapshot/eks/node_modules/@grpc/grpc-js/src/resolving-call.ts:163:24
        at processTicksAndRejections (node:internal/process/task_queues:77:11)